II. GRAPH REPRESENTATIONS USING
COMPUTER SYSTEMS
In general, there are four ways to represent a
graph in a computer system: The incidence list
representation, the incidence matrix representation,
adjacency list representation, and the adjacency
matrix representation.
Incidence List - This representation uses an
array. Each element in the array corresponds with a
single edge. Each edge contains a list of size two
which corresponds to the endpoints of the edge.
This can also apply to directed graphs by ensuring
the first vertex be defined as the source or
destination while the second should be defined as
the opposite.
Incidence matrix - This representation uses a
matrix of M edges by N vertices. If the vertex is an
endpoint to the edge, a value of 1 is assigned to
their crossing, otherwise, a value of 0 is assigned.
This is a terrible waste of space as every column or
row represented by the edge can only have two
values of 1 while the rest are labelled 0.