|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.hawaii.ics.yucheng.GraphSolver
edu.hawaii.ics.yucheng.JadeSolver
class JadeSolver
A graph solver that runs in O(V*E) time.
Nested Class Summary | |
---|---|
(package private) class |
JadeSolver.GraphData
A class that encapsulates the graph file conveniently for the algorithm. |
(package private) class |
JadeSolver.Queue
A queue used to hold a collection of vertex nodes. |
(package private) class |
JadeSolver.SolutionMatrix
A solution matrix, which is a matrix with v rows and v columns that holds booleans indicating whether or not vertices are connected. |
(package private) class |
JadeSolver.VertexNode
Implementation of a vertex node. |
Field Summary | |
---|---|
private static int |
INFINITE_HOPS
|
private static float |
INFINITE_WEIGHT
|
Constructor Summary | |
---|---|
JadeSolver()
|
Method Summary | |
---|---|
private void |
animate(JadeSolver.SolutionMatrix solution)
Animates a partial solution. |
(package private) static GraphSolution |
getSolution(float bestWeight,
JadeSolver.VertexNode bestRoot,
JadeSolver.SolutionMatrix bestSolution)
Static methods cannot be declared in inner classes due to a java limitation, so this method is implemented here instead of the SolutionMatrix class. |
GraphSolution |
solve(Graph g)
Solves a graph or returns null if there is no solution. |
Methods inherited from class edu.hawaii.ics.yucheng.GraphSolver |
---|
addGraphListener, isAnimating, publish, removeGraphListener, startAnimation, startAnimation, stopAnimation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int INFINITE_HOPS
private static final float INFINITE_WEIGHT
Constructor Detail |
---|
JadeSolver()
Method Detail |
---|
static GraphSolution getSolution(float bestWeight, JadeSolver.VertexNode bestRoot, JadeSolver.SolutionMatrix bestSolution)
bestWeight
- The best weight.bestRoot
- The best root index.bestSolution
- The best solution.
private void animate(JadeSolver.SolutionMatrix solution)
solution
- The partial solution.public GraphSolution solve(Graph g)
solve
in class GraphSolver
g
- The graph.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |