tests.fixtures.weighted_graphs.graph_cheapest_is_shortest

tests.fixtures.weighted_graphs.graph_cheapest_is_shortest#

tests.fixtures.weighted_graphs.graph_cheapest_is_shortest()#

This graph is a fairly common case in the wild where the cheapest path is also the shortest, but it is not homogenously weighted.

left to right direction

object 0
object 1
object 2
object 3
object 4
object 5

0 --> 1 : 1
1 --> 2 : 1
2 --> 3 : 1
3 --> 4 : 1
4 --> 5 : 1
0 --> 5 : 4

Returns:

a two-tuple containing a Universe of the graph, and a list of all Vertex objects. The order of this list is shown by the numbers in the above diagram; the number of a vertex is its index in the list.

Edges on the graph have a weight attribute.