8.4 Maintaining the Reduced Graph
With the vertex elimination data structure established, maintenance and query operations are straightforward. Algorithm 18 implements increase_degree. It assumes the list communication buffer is .
increase_degree() |
evaluate() |
map() |
find() |
while and evaluate() |
ext() |
link() |
unlink() |
In words, Algorithm 18 increases the degree of and scans the degree list in ascending order until the new position of is located. It then adds into at this position and deletes from the old position. In the worst case, the loop in Algorithm 18 is an operation. This degenerate case only occurs when all vertices in have the same degree and is the first item in .
decrease_degree() |
evaluate() |
map() |
find() |
while and evaluate() |
previous() |
link() |
unlink() |
Algorithm 19 implements the decrease_degree operation. It decreases the degree of then scans the degree list in descending order until the new position of is located. It then adds into at this position and deletes from the old position. Once again, Algorithm 19 is an in the worse case. In the average case, it is much closer .
The remove operator (Algorithm 20) excises from the degree list and makes sure its degree count is less than or equal to zero in the mapping .
remove() |
find() |
unlink() |
map() |