Graph updating algorithm

Viewed 977

I have a (un-directed) graph represented using adjacency lists, e.g.

a: b, c, e
b: a, d
c: a, d
d: b, c
e: a

where each node of the graph is linked to a list of other node(s)

I want to update such a graph given some new list(s) for certain node(s), e.g.

a: b, c, d

where a is no longer connected to e, and is connected to a new node d

What would be an efficient (both time and space wise) algorithm for performing such updates to the graph?

3 Answers
Related