|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgo.Graph
public class Graph
A Graph for an TSP Problem.
Field Summary | |
---|---|
protected double[][] |
g
|
(package private) static double |
INFINITY
|
Constructor Summary | |
---|---|
Graph(int n)
Constructs an unconnected graph of given size. |
Method Summary | |
---|---|
void |
connect(int i,
int j,
double d)
Connect two nodes by defining a distance. |
double |
distance(int i,
int j)
Get the distance between two nodes. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[][] g
static final double INFINITY
Constructor Detail |
---|
public Graph(int n)
n
- size of the graph.Method Detail |
---|
public void connect(int i, int j, double d)
i
- node number.j
- node number.d
- distance between the two nodes.public double distance(int i, int j)
i
- node number.j
- node number.
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |