You task is to code a small collection of graph algorithms, based on your directed_graph class for assignment 1 (all vertices and edges have positive weights): • Shortest paths. • Strongly connected components. • Topological sort. Besides the above, the class should offer an operation to solve the following open question: • Consider each vertex as a city, vertex weight as the city’s population, and the weight of each directed edge as the cost of delivering any amount of goods from one city to another. Given a city that plans to deliver goods to all other cities, can you find a way to deliver the goods to every other city with the minimum average-delivery-cost per person? Your function should return this minimum cost-per-person.
#Sales Offer!| Get upto 25% Off: