Professional Documents
Culture Documents
L0 L1
B A C E F D
Algorithm Example Properties Analysis Applications Comparison of applications Comparison of edge labels
Breadth-First Search 2
L2
5/7/2002 11:06 AM
Breadth-First Search
5/7/2002 11:06 AM
Breadth-First Search
Breadth-first search (BFS) is a general technique for traversing a graph A BFS traversal of a graph G
BFS Algorithm
The algorithm uses a mechanism for setting and getting labels of vertices and edges Algorithm BFS(G) Input graph G Output labeling of the edges and partition of the vertices of G for all u G.vertices() setLabel(u, UNEXPLORED) for all e G.edges() setLabel(e, UNEXPLORED) for all v G.vertices() if getLabel(v) = UNEXPLORED BFS(G, v)
5/7/2002 11:06 AM
Visits all the vertices and edges of G Determines whether G is connected Computes the connected components of G Computes a spanning forest of G
BFS on a graph with n vertices and m edges takes O(n + m ) time BFS can be further extended to solve other graph problems
Find and report a path with the minimum number of edges between two given vertices Find a simple cycle, if there is one
3
Algorithm BFS(G, s) L0 new empty sequence L0.insertLast(s) setLabel(s, VISITED) i0 while Li.isEmpty() Li +1 new empty sequence for all v Li.elements() for all e G.incidentEdges(v) if getLabel(e) = UNEXPLORED w opposite(v,e) if getLabel(w) = UNEXPLORED setLabel(e, DISCOVERY) setLabel(w, VISITED) Li +1.insertLast(w) else setLabel(e, CROSS) i i +1
4
5/7/2002 11:06 AM
Breadth-First Search
Breadth-First Search
Example
A A
L0 L1
B
Example (cont.)
A C E F D
unexplored vertex visited vertex unexplored edge discovery edge cross edge
L0
A C E F D
L0 L1
B
A C E F D
L0 L1
B
A C E F D
L2
L0 L1
B
A C E F
5
L0
D
A C E F
Breadth-First Search
L0
D
A C E F
6
L1
L1
L1
L2
L2
5/7/2002 11:06 AM
Breadth-First Search
5/7/2002 11:06 AM
Example (cont.)
L0 L1
B A C E F D
Properties
L0 L1
B A C E F D
A C E F D
L2
L2
BFS(G, s) visits all the vertices and edges of Gs The discovery edges labeled by BFS(G, s) form a spanning tree Ts of Gs For each vertex v in Li
L0 L1
B
L0 L1
B
A C E F
Breadth-First Search 7
Property 3
D
A C E F
8
L2
The path of Ts from s to v has i edges Every path from s to v in Gs has at least i edges
Breadth-First Search
L2
5/7/2002 11:06 AM
5/7/2002 11:06 AM
Analysis
Setting/getting a vertex/edge label takes O(1) time Each vertex is labeled twice
Applications
Using the template method pattern, we can specialize the BFS traversal of a graph G to solve the following problems in O(n + m) time
Each vertex is inserted once into a sequence Li Method incidentEdges is called once for each vertex BFS runs in O(n + m) time provided the graph is represented by the adjacency list structure
Recall that
v deg(v) = 2m
Breadth-First Search 9
Compute the connected components of G Compute a spanning forest of G Find a simple cycle in G, or report that G is a forest Given two vertices of G, find a path in G between them with the minimum number of edges, or report that no such path exists
Breadth-First Search 10
5/7/2002 11:06 AM
5/7/2002 11:06 AM
BFS
w is in the same level as v or in the next level in the tree of discovery edges
A C E F D
L0 L1
B
A C E F D B
A C E F D
L0 L1
B
L2
L2
DFS
5/7/2002 11:06 AM Breadth-First Search
BFS
11 5/7/2002 11:06 AM
DFS
Breadth-First Search
BFS
12
Definitions (6.3.2)
Separation vertices and edges Biconnected graph Biconnected components Equivalence classes Linked edges and link components Auxiliary graph Proxy graph
Biconnectivity 2
Algorithms (6.3.2)
5/7/2002 11:09 AM
Biconnectivity
5/7/2002 11:09 AM
Biconnected Graph
Equivalent definitions of a biconnected graph G
Let G be a connected graph A separation edge of G is an edge whose removal disconnects G A separation vertex of G is a vertex whose removal disconnects G Separation edges and vertices represent single points of failure in a network and are critical to the operation of the network DFW, LGA and LAX are separation vertices (DFW,LAX) is a separation edge ORD SFO LGA HNL LAX DFW
Biconnectivity
Applications
Example
Graph G has no separation edges and no separation vertices For any two vertices u and v of G, there are two disjoint simple paths between u and v (i.e., two simple paths between u and v that share no other vertices or edges) For any two vertices u and v of G, there is a simple cycle containing u and v
ORD LGA PVD
Example
PVD HNL MIA
3 5/7/2002 11:09 AM
SFO
LAX
DFW
Biconnectivity
MIA
4
5/7/2002 11:09 AM
Biconnected Components
Biconnected component of a graph G
Equivalence Classes
Given a set S, a relation R on S is a set of ordered pairs of elements of S, i.e., R is a subset of SS An equivalence relation R on S satisfies the following properties
Reflexive: (x,x) R Symmetric: (x,y) R (y,x) R Transitive: (x,y) R (y,z) R (x,z) R
A maximal biconnected subgraph of G, or A subgraph consisting of a separation edge of G and its end vertices An edge belongs to exactly one biconnected component A nonseparation vertex belongs to exactly one biconnected component A separation vertex belongs to two or more biconnected components
An equivalence relation R on S induces a partition of the elements of S into equivalence classes Example (connectivity relation among the vertices of a graph):
SFO
Let V be the set of vertices of a graph G Define the relation C = {(v,w) VV such that G has a path from v to w} Relation C is an equivalence relation The equivalence classes of relation C are the vertices in each connected component of graph G
Biconnectivity 6
5/7/2002 11:09 AM
5/7/2002 11:09 AM
Link Relation
Edges e and f of connected graph G are linked if
Link Components
a b c e d f g j i The link components of a connected graph G are the equivalence classes of edges with respect to the link relation A biconnected component of G is the subgraph of G induced by an equivalence class of linked edges A separation edge is a single-element equivalence class of linked edges A separation vertex has incident edges in at least two distinct equivalence classes of linked edge
ORD LGA PVD RDU MIA
8
b c
e d f
SFO HNL
LAX
DFW
Biconnectivity
Biconnectivity
5/7/2002 11:09 AM
Auxiliary Graph
Auxiliary graph B for a connected graph G
g b c a d e
h i j f i
Associated with a DFS traversal of G The vertices of B are the edges of G For each back edge e of G, B has edges (e,f1), (e,f2) , , (e,fk), where f1, f2, , fk are the discovery edges of G that form a simple cycle with e Its connected components correspond to the the link components of G
DFS on graph G
g b c a d e h f j i
Auxiliary graph B
9
DFS on graph G
5/7/2002 11:09 AM Biconnectivity
Auxiliary graph B
10
5/7/2002 11:09 AM
Biconnectivity
Proxy Graph
Algorithm proxyGraph(G) Input connected graph G Output proxy graph F for G F empty graph DFS(G, s) { s is any vertex of G} for all discovery edges e of G F.insertVertex(e) setLabel(e, UNLINKED) for all vertices v of G in DFS visit order for all back edges e = (u,v) F.insertVertex(e) while u s f discovery edge with dest. u F.insertEdge(e,f,) if f getLabel(f) = UNLINKED setLabel(f, LINKED) u origin of edge f else u s { ends the while loop } return F
5/7/2002 11:09 AM Biconnectivity
h i i
g b c a d e
h i j f i
DFS on graph G
g b c a d e h f j i
Spanning forest of the auxiliary graph B Has m vertices and O(m) edges Can be constructed in O(n + m) time Its connected components (trees) correspond to the the link components of G
DFS on graph G
g b c a d e h f j i
Given a graph G with n vertices and m edges, we can compute the following in O(n + m) time
Proxy graph F
11
Proxy graph F
12
5/7/2002 11:09 AM
Depth-First Search
A B C D E
Subgraph Connectivity Spanning trees and forests Algorithm Example Properties Analysis Path finding Cycle finding
Depth-First Search 2
Depth-First Search
Subgraphs
A subgraph S of a graph G is a graph such that
Connectivity
A graph is connected if there is a path between every pair of vertices A connected component of a graph G is a maximal connected subgraph of G
3
The vertices of S are a subset of the vertices of G The edges of S are a subset of the edges of G
Subgraph
Connected graph
Depth-First Search
Tree
Graph
A forest is an undirected graph without cycles The connected components of a forest are trees
Depth-First Search
Forest
Spanning tree
6
Depth-First Search
Depth-first search (DFS) is a general technique for traversing a graph A DFS traversal of a graph G
DFS Algorithm
The algorithm uses a mechanism for setting and getting labels of vertices and edges Algorithm DFS(G) Input graph G Output labeling of the edges of G as discovery edges and back edges for all u G.vertices() setLabel(u, UNEXPLORED) for all e G.edges() setLabel(e, UNEXPLORED) for all v G.vertices() if getLabel(v) = UNEXPLORED DFS(G, v) Algorithm DFS(G, v) Input graph G and a start vertex v of G Output labeling of the edges of G in the connected component of v as discovery edges and back edges setLabel(v, VISITED) for all e G.incidentEdges(v) if getLabel(e) = UNEXPLORED w opposite(v,e) if getLabel(w) = UNEXPLORED setLabel(e, DISCOVERY) DFS(G, w) else setLabel(e, BACK)
8
Visits all the vertices and edges of G Determines whether G is connected Computes the connected components of G Computes a spanning forest of G
DFS on a graph with n vertices and m edges takes O(n + m ) time DFS can be further extended to solve other graph problems
Find and report a path between two given vertices Find a cycle in the graph
Depth-First Search
Depth-First Search
Example
A A
Example (cont.)
A B C D E B C A D E B C A D E
unexplored vertex visited vertex unexplored edge discovery edge back edge
A B C
Depth-First Search
A D E B C
9
A D E B C
Depth-First Search
A D E B C
10
Properties of DFS
Property 1
DFS(G, v) visits all the vertices and edges in the connected component of v
A
We mark each intersection, corner and dead end (vertex) visited We mark each corridor (edge ) traversed We keep track of the path back to the entrance (start vertex) by means of a rope (recursion stack)
Depth-First Search 11
Property 2
The discovery edges labeled by DFS(G, v) form a spanning tree of the connected component of v
Depth-First Search
12
Analysis of DFS
Setting/getting a vertex/edge label takes O(1) time Each vertex is labeled twice
Path Finding
We can specialize the DFS algorithm to find a path between two given vertices u and z using the template method pattern We call DFS(G, u) with u as the start vertex We use a stack S to keep track of the path between the start vertex and the current vertex As soon as destination vertex z is encountered, we return the path as the contents of the stack
13
Method incidentEdges is called once for each vertex DFS runs in O(n + m) time provided the graph is represented by the adjacency list structure
Recall that
v deg(v) = 2m
Depth-First Search
Algorithm pathDFS(G, v, z) setLabel(v, VISITED) S.push(v) if v = z return S.elements() for all e G.incidentEdges(v) if getLabel(e) = UNEXPLORED w opposite(v,e) if getLabel(w) = UNEXPLORED setLabel(e, DISCOVERY) S.push(e) pathDFS(G, w, z) S.pop(e) else setLabel(e, BACK) S.pop(v)
14
Depth-First Search
Cycle Finding
We can specialize the DFS algorithm to find a simple cycle using the template method pattern We use a stack S to keep track of the path between the start vertex and the current vertex As soon as a back edge (v, w) is encountered, we return the cycle as the portion of the stack from the top to vertex w
Algorithm cycleDFS(G, v, z) setLabel(v, VISITED) S.push(v) for all e G.incidentEdges(v) if getLabel(e) = UNEXPLORED w opposite(v,e) S.push(e) if getLabel(w) = UNEXPLORED setLabel(e, DISCOVERY) pathDFS(G, w, z) S.pop(e) else T new empty stack repeat o S.pop() T.push(o) until o = w return T.elements() S.pop(v)
15
Depth-First Search
Reachability (6.4.1)
BOS
LAX
MIA
Topological Sorting
Directed Graphs 2
Directed Graphs
Digraphs
A digraph is a graph whose edges are all directed Applications
Digraph Properties
C E D C B A
B A
If G is simple, m < n*(n-1). If we keep in-edges and out-edges in separate adjacency lists, we can perform listing of inedges and out-edges in time proportional to their size.
Directed Graphs 4
Directed Graphs
Digraph Application
Scheduling: edge (a,b) means task a must be completed before b can be started
ics21 ics22 ics23
Directed DFS
We can specialize the traversal algorithms (DFS and BFS) to digraphs by traversing edges only along their direction In the directed DFS algorithm, we have four types of edges
E D C B A
ics51
ics53
ics52 ics161
ics131
ics141
ics121
ics171
ics151
Directed Graphs
Reachability
DFS tree rooted at v: vertices reachable from v via directed paths
E D C
Strong Connectivity
Each vertex can reach all other vertices
a c d
D C A
Directed Graphs
E C A
D F B
A E
e
F
f
7 Directed Graphs
b
8
e b
Maximal subgraphs such that each vertex can reach all other vertices in the subgraph Can also be done in O(n+m) time using DFS, but is more complicated (similar to biconnectivity). a c g
{a,c,g}
d f
e b
e b
{f,d,e,b}
10
Directed Graphs
Transitive Closure
Given a digraph G, the transitive closure of G is the digraph G* such that G* has the same vertices as G if G has a directed path from u to v (u v), G* has a directed edge from u to v The transitive closure provides reachability information about a digraph
Directed Graphs
E G
If there's a way to get from A to B and from B to C, then there's a way to get from A to C.
O(n(n+m))
Floyd-Warshalls Algorithm
Algorithm FloydWarshall(G) Input digraph G Output transitive closure G* of G i1 for all v G.vertices() G0=G denote v as vi Gk has a directed edge (vi, vj) ii+1 if G has a directed path from G0 G vi to vj with intermediate for k 1 to n do vertices in the set {v1 , , vk} Gk Gk 1 We have that Gn = G* for i 1 to n (i k) do for j 1 to n (j i, k) do In phase k, digraph Gk is computed from Gk 1 if Gk 1.areAdjacent(vi, vk) Gk 1.areAdjacent(vk, vj) Running time: O(n3), if Gk.areAdjacent(vi, vj) assuming areAdjacent is O(1) Gk.insertDirectedEdge(vi, vj , k) (e.g., adjacency matrix) return Gn
Floyd-Warshalls algorithm numbers the vertices of G as v1 , , vn and computes a series of digraphs G0, , Gn
Directed Graphs
Directed Graphs
14
Floyd-Warshall Example
BOS ORD
v7
Floyd-Warshall, Iteration 1
BOS ORD
v7
v4
JFK
v4
JFK
v2
SFO
v6
v2
SFO
v6
LAX
DFW
v1
v3
MIA
LAX
DFW
v1
v3
MIA
v5
Directed Graphs 15 Directed Graphs
v5
16
Floyd-Warshall, Iteration 2
BOS ORD
v7
Floyd-Warshall, Iteration 3
BOS ORD
v7
v4
JFK
v4
JFK
v2
SFO
v6
v2
SFO
v6
LAX
DFW
v1
v3
MIA
LAX
DFW
v1
v3
MIA
v5
Directed Graphs 17 Directed Graphs
v5
18
Floyd-Warshall, Iteration 4
BOS ORD
v7
Floyd-Warshall, Iteration 5
BOS ORD
v7
v4
JFK
v4
JFK
v2
SFO
v6
v2
SFO
v6
LAX
DFW
v1
v3
MIA
LAX
DFW
v1
v3
MIA
v5
Directed Graphs 19 Directed Graphs
v5
20
Floyd-Warshall, Iteration 6
BOS ORD
v7
Floyd-Warshall, Conclusion
BOS ORD
v7
v4
JFK
v4
JFK
v2
SFO
v6
v2
SFO
v6
LAX
DFW
v1
v3
MIA
LAX
DFW
v1
v3
MIA
v5
Directed Graphs 21 Directed Graphs
v5
22
Topological Sorting
Number vertices, so that (u,v) in E implies u < v
wake up 1
D B C A D B C A v4
DAG G E v5
7 play
5 more c.s.
v3 Topological ordering of G
23
6 work out
Directed Graphs
9
Directed Graphs 27 Directed Graphs 28
7 8 9
Directed Graphs 29
8 9
Directed Graphs 30
6 7 8 9
Directed Graphs 31
6 7 8 9
Directed Graphs
32
4 6 7 8 9
Directed Graphs 33
4 5 6 7 8 9
Directed Graphs 34
6 7 8 9
Directed Graphs
36
Graphs (6.1)
SFO
337
1843
43 17
ORD
Definition Applications Terminology Properties ADT Edge list structure Adjacency list structure Adjacency matrix structure
Graphs 2
LAX
1233
DFW
5/3/2002 7:41 AM
Graphs
5/3/2002 7:41 AM
Graph
A graph is a pair (V, E), where
Edge Types
Directed edge
V is a set of nodes, called vertices E is a collection of pairs of vertices, called edges Vertices and edges are positions and store elements A vertex represents an airport and stores the three-letter airport code An edge represents a flight route between two airports and stores the mileage of the route
Example:
ordered pair of vertices (u,v) first vertex u is the origin second vertex v is the destination e.g., a flight unordered pair of vertices (u,v) e.g., a flight route all the edges are directed e.g., route network all the edges are undirected e.g., flight network
Graphs
ORD
PVD
Undirected edge
ORD
PVD
802
SFO
337
1843
43 17
ORD
849
2 14
PVD
Directed graph
HNL
2555
LAX
1233
DFW
7 138 1120
LGA
10 99
Undirected graph
MIA
3
5/3/2002 7:41 AM
Graphs
5/3/2002 7:41 AM
Applications
cslab1a cslab1b math.brown.edu
Terminology
End vertices (or endpoints) of an edge
Electronic circuits
Transportation networks
cs.brown.edu
U and V are the endpoints of a a, d, and b are incident on V U and V are adjacent X has degree 5 h and i are parallel edges j is a self-loop
Graphs
a U c
V d
b X e
h Z i g
Adjacent vertices
Computer networks
Degree of a vertex
W f
Parallel edges
Databases
Self-loop
Entity-relationship diagram
Graphs 5
5/3/2002 7:41 AM
5/3/2002 7:41 AM
Terminology (cont.)
Path
Terminology (cont.)
Cycle
sequence of alternating vertices and edges begins with a vertex ends with a vertex each edge is preceded and followed by its endpoints path such that all its vertices and edges are distinct P1=(V,b,X,h,Z) is a simple path P2=(U,c,W,e,X,g,Y,f,W,d,V) is a path that is not simple
a U c
V d P2 W f
P1 X h Z
circular sequence of alternating vertices and edges each edge is preceded and followed by its endpoints cycle such that all its vertices and edges are distinct C1=(V,b,X,g,Y,f,W,c,U,a,) is a simple cycle C2=(U,c,W,e,X,g,Y,f,W,d,V,a,) is a cycle that is not simple
a U c
V d C2 W f
b X e h C1 g Y Z
Simple cycle
Simple path
e g Y
Examples
Examples
5/3/2002 7:41 AM
Graphs
5/3/2002 7:41 AM
Graphs
Properties
Property 1 Notation
n m deg(v) number of vertices number of edges degree of vertex v
v deg(v) = 2m
Proof: each endpoint is counted twice
Update methods
are positions store elements aVertex() incidentEdges(v) endVertices(e) isDirected(e) origin(e) destination(e) opposite(v, e) areAdjacent(v, w)
Property 2
In an undirected graph with no selfloops and no multiple edges m n (n 1)/2 Proof: each vertex has degree at most (n 1)
5/3/2002 7:41 AM Graphs
Accessor methods
Example n = 4 m = 6 deg(v) = 3
Generic methods
5/3/2002 7:41 AM
Graphs
10
element reference to position in vertex sequence element origin vertex object destination vertex object reference to position in edge sequence sequence of vertex objects sequence of edge objects
Graphs
a v
a u
b w
Edge object
Vertex sequence
Edge sequence
5/3/2002 7:41 AM
11
5/3/2002 7:41 AM
Graphs
12
Performance
n vertices m edges no parallel edges no self-loops
a u
b w
Adjacency Matrix n2 n 1 n2 1 n2 1
14
Reference to edge object for adjacent vertices Null for non nonadjacent vertices
5/3/2002 7:41 AM
Graphs
13
Partition ADT and implementation (4.2.2) The decorator pattern (6.5.1) The traveling salesperson problem
6/8/2002 2:07 PM
Campus Tour
6/8/2002 2:07 PM
Campus Tour
Graph Assignment
Goals
a u
b w
Learn and implement the adjacency matrix structure an Kruskals minimum spanning tree algorithm Understand and use the decorator pattern and various JDSL classes and interfaces Implement the adjacency matrix structure for representing a graph Implement Kruskals MST algorithm Computation and visualization of an approximate traveling salesperson tour
Campus Tour 3
Your task
Frontend
Reference to edge object for adjacent vertices Null for non nonadjacent vertices
6/8/2002 2:07 PM
6/8/2002 2:07 PM
Campus Tour
Kruskals Algorithm
The vertices are partitioned into clouds
Example
B 1 A 5 7 10 8 9 C 11 E 3 D H G 4 6 2 A F 1 B 5 7 10 8 9 C 11 E 3 D H G 4 6 2 F
We start with one cloud per vertex Clouds are merged during the execution of the algorithm makeSet(o): create set {o} and return a locator for object o find(l): return the set of the object with locator l union(A,B): merge sets A and B
Algorithm KruskalMSF(G) Input weighted graph G Output labeling of the edges of a minimum spanning forest of G Q new heap-based priority queue for all v G.vertices() do l makeSet(v) { elementary cloud } setLocator(v,l) for all e G.edges() do Q.insert(weight(e), e) while Q.isEmpty() e Q.removeMin() [u,v] G.endVertices(e) A find(getLocator(u)) B find(getLocator(v)) if A B setMSFedge(e) { merge clouds } union(A, B)
5
Partition ADT:
B 1 A 5 7
8 9 C 11 10 E 3 D
G 4 6 H 2 A
Campus Tour
B F 1 5 7
8 9 C 11 10 E 3 D
G 4 6 H 2 F
6/8/2002 2:07 PM
Campus Tour
6/8/2002 2:07 PM
Example (contd.)
B 1 A 5 7 10 8 9 C 11 E 3 D H G 4 6 2 A F 1 B 5 7 10 8 9 C 11 E 3 D H G 4 6 2 F
Partition Implementation
Partition implementation
st e
ps
four steps
B 1 A 5 7 10 8 9 C 11 E 3 D H G 4 6 2 F
B 1 A 5 7
8 9 C 11 10 E 3 D
4 6 H 2 F
tw o
A set is represented the sequence of its elements A position stores a reference back to the sequence itself (for operation find) The position of an element in the sequence serves as locator for the element in the set In operation union, we move the elements of the smaller sequence into to the larger sequence makeSet, find: O(1) union: O(min(nA, nB))
Campus Tour
Amortized analysis
Consider a series of k Partiton ADT operations that includes n makeSet operations Each time we move an element into a new sequence, the size of its set at least doubles An element is moved at most log2 n times Moving an element takes O(1) time The total time for the series of operations is O(k + n log n)
8
6/8/2002 2:07 PM
Campus Tour
6/8/2002 2:07 PM
Decorator Pattern
Labels are commonly used in graph algorithms
Methods vertices and edges are called once Method endVertices is called m times We perform m insert operations and m removeMin operations We perform n makeSet operations, 2m find operations and no more than n 1 union operations
Auxiliary data Output DFS: unexplored/visited label for vertices and unexplored/ forward/back labels for edges Dijkstra and Prim-Jarnik: distance, locator, and parent labels for vertices Kruskal: locator label for vertices and MSF label for edges
Campus Tour
The decorator pattern extends the methods of the Position ADT to support the handling of attributes (labels)
Examples
Partition operations
Label operations
Kruskals algorithm runs in time O((n + m) log n) time provided the graph has no parallel edges and is represented by the adjacency list structure
6/8/2002 2:07 PM Campus Tour 9
has(a): tests whether the position has attribute a get(a): returns the value of attribute a set(a, x): sets to x the value of attribute a destroy(a): removes attribute a and its associated value (for cleanup purposes)
The decorator pattern can be implemented by storing a dictionary of (attribute, value) items at each position
10
6/8/2002 2:07 PM
TSP Approximation
4
B 2 A 5 6 C
7 2 8 1
D F E 3
We can approximate a TSP tour with a tour of at most twice the weight for the case of Euclidean graphs
Find a polynomial-time algorithm computing a traveling salesperson tour or prove that none exists
Campus Tour
Vertices are points in the plane Every pair of vertices is connected by an edge The weight of an edge is the length of the segment joining the points Compute a minimum spanning tree Form an Eulerian circuit around the MST Transform the circuit into a tour
Campus Tour 12
Approximation algorithm
6/8/2002 2:07 PM
11
6/8/2002 2:07 PM