Algorithm

Closed Chain

 

Input:

A multigraph G, a set U of unused edges of G, with each vertex appearing in an even number of edges in U, and a designated vertex x which appears in some edge of U.

Output:

A closed chain from x to x which uses each eadge of U at most once.

Step 1: Set v = x and output x

{v is the last vertex visited}

Step 2: If there is an edge {v,y} in U, remove {v,y}, set v = y, output y from U and repeat this step.

Step 3: If there is no edge {v,y} in U stop. The outputs in order give us the desired chain from x to x.

Up One Level

Back to the Discrete Mathematics & Graph Theory Introduction

Lisa's Home Page