Both Directed and Undirected Edges may be WEIGHTED or UNWEIGHTED.

A WEIGHTED EDGE is like a tollway; it costs a certain amount to travel along that edge in either direction.

An UNWEIGHTED EDGE, on the other hand, is like a freeway. It costs nothing to travel along that edge. Like Directed and Undirected edges, you cannot mix Weighted and Unweighted Edges. All edges in a graph must be either WEIGHTED or UNWEIGHTED.

In the first example graph, the directed edge from A to B has a weight of 5. The edge from B to C has weight 15. In the second example, the edges are unweighted.


Choose topics to learn more about graph and graph algorithms

Back to AlgoNet Home