A Scalable Distributed Dynamical Systems Approach to Learn the Strongly Connected Components and Diameter of Networks