Abstract:
|
The design of efficient graph algorithms usually precludes the test of
edge existence, because an efficient support of that operation already
requires time (n^2) for the initialization of an
adjacency-matrix representation. We describe an alternative
representation of static directed graphs taking (n+m)
initialization time and using (n^2) space, which supports the
efficient implementation of all usual operations on static graphs. The
sparse graph representation allows the design of efficient graph
algorithms using both iteration over all vertices adjacent with a
given vertex and edge-existence operations, although at the expense of
additional (uninitialized) space which may, nevertheless, be used for
other purposes. To the best of our knowledge, the representation leads
to the first graph algorithms with the disconcerting property that the
time complexity is better than the space complexity. |