There are two types of Edges, DIRECTED and UNDIRECTED.

A DIRECTED EDGE can be thought of as a one-way road. Objects can only travel in one direction along the edge. A DIRECTED EDGE is commonly drawn using an arrow to point the direction of the edge.

An UNDIRECTED EDGE, on the other hand, has no restrictions for travelling on it. Objects can freely move in either direction along an UNDIRECTED EDGE. UNDIRECTED EDGES are commonly drawn as a simple line between two Vertices, with no arrow on either end.

All the edges in a graph must be either DIRECTED or UNDIRECTED. The two types of edges cannot be mixed together. A graph that uses only DIRECTED EDGES is called a DIRECTED GRAPH. Likewise, a graph that uses only UNDIRECTED EDGES is called an UNDIRECTED GRAPH.

In the first example graph, there is a directed edge from A to B and from B to C. In the second example graph, the edges are not directed.

In a directed edge, we call the first vertex in the edge pair the TAIL of the edge, and the second vertex the HEAD of the edge. This is because when a directed edge is specified (A, B), it goes from vertex A and to vertex B.


Choose topics to learn more about graph and graph algorithms

Back to AlgoNet Home