In mathematics, a graph is usually represented as two sets, V and E. SET V is the set of all Vertices contained in the graph, and SET E is the set of all Edges in the graph.

Set E is usually made up of pairs of vertices. The first member of the vertex pair tells where the edge is coming from, and the second member of the vertex pair tells where the edge is going.

In the example here, the graph is made up of four vertices and three Edges. Note that the edge between vertex A and B is represented by the pair (A, B).

In an undirected graph, edge (A, B) and edge (B, A) are the same. Therefore we say that edge (A, B) implies edge (B, A).

If the edges of a graph are weighted, then a graph is specified with a third set with the sets V and E. The third set is set W. Set W contains the weights of each edge in the graph. Set W is specified in the same order as set E, so that it is easy to tell the weights associated with each edge.


Choose topics to learn more about graph and graph algorithms

Back to AlgoNet Home