-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphAlgorithmObserver.java
More file actions
56 lines (47 loc) · 1.7 KB
/
GraphAlgorithmObserver.java
File metadata and controls
56 lines (47 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package graph;
import java.util.List;
public interface GraphAlgorithmObserver<V> {
/** Called by the graph to notify this Observer that
* a Depth-First-Search has been initiated.
*/
public void notifyDFSHasBegun();
/** Called by the graph to notify this Observer that
* a Breadth-First Search has been initiated.
*/
public void notifyBFSHasBegun();
/** Called by the graph to notify this Observer that
* a vertex is being "visited" during either DFS or BFS.
*
* @param vertexBeingVisited
*/
public void notifyVisit(V vertexBeingVisited);
/** Called by the graph to notify this observer that
* the search (either DFS or BFS) is over.
*/
public void notifySearchIsOver();
/** Called by the graph to notify this observer that
* Dijkstra's algorithm has begun.
*/
public void notifyDijkstraHasBegun();
/** Called by the graph to notify this observer that
* a vertex has been added to the "Finished Set"
* during Dijkstra's algorithm. The second parameter
* is the "cost" (total weight) of the best path
* leading from the starting vertex to the one referenced
* by the first parameter.
*
* @param vertexAddedToFinishedSet
* @param costOfPath
*/
public void notifyDijkstraVertexFinished(V vertexAddedToFinishedSet, Integer costOfPath);
/**
* <P>Called by the graph to notify this observer that
* Dijkstra's algorithm is over.</P>
*
* @param path A list of Vertices that are connected along edges,
* beginning with the "starting vertex" and ending with the
* "finishing vertex". This will be the optimal (lowest cost)
* path from start to finish.
*/
public void notifyDijkstraIsOver(List<V> path);
}