8.1 Eliminating a Single Vertex

Assuming that the graph G G is represented by a list of vertices V G V(G) and a list of edges E G E(G) , Algorithm 16 eliminates vertex v v from G G . It assumes the buffer e e provides communication with the edge list.

Algorithm 16: Eliminate a Vertex from a Graph
adjacency_list( V , E V,E )
for all vertices w w adjacent to v v
   for all vertices z z adjacent to v v
      if  w z w\neq z  and find( E , w , z E,w,z ) is e o l eol
          e . v = w e.v=w
          e . w = z e.w=z
         link( E , 1 E,1 )
    i = i= find( E , w , z E,w,z )
   unlink( E , i E,i )
i = i= find( V , v V,v )
unlink( V , i V,i )

The operation adjacency_list creates an adjacency list from V G V(G) and E G E(G) . In Section 4, Algorithms 1 and Algorithm 3 were presented to solve this problem. New edges created during vertex elimination are arbitrarily inserted at the beginning of the edge list. For the current purposes, the insertion point is irrelevant.