DestroyGraph:
PUBLIC
PROC [graph: RouteDiGraph.Graph, enumGraph: RouteDiGraph.EnumGraphProc, enumNode: RouteDiGraph.EnumNodeProc, enumArc: RouteDiGraph.EnumArcProc] = {
There may be circular references. enumGraph, enumNode and enumArc allow client to NIL any circular references in graphInfo, nodeInfo and arcInfo if necessary
UnlinkNode: RouteDiGraph.EnumNodeProc =
{
DeleteArcs: RouteDiGraph.EnumArcsFromNodeProc =
graph.nodeList ← List.Remove[node, graph.nodeList];
[] ← RouteDiGraph.EnumArcsFromNode[graph, node, both, DeleteArcs];
};
first do the client data
IF enumNode # NIL THEN [] ← EnumNodes[graph, enumNode];
IF enumArc # NIL THEN [] ← EnumArcs[graph, enumArc];
IF enumGraph # NIL THEN [] ← enumGraph[graph];
next unlink the arcs from the nodes
[] ← EnumNodes[graph, UnlinkNode];
};