|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.ucsb.cs.jicos.applications.utilities.graph.GraphImpl
public class GraphImpl
| Field Summary |
|---|
| Fields inherited from interface edu.ucsb.cs.jicos.applications.utilities.graph.Graph |
|---|
METRIC_EUC_2D, METRIC_GEO |
| Constructor Summary | |
|---|---|
GraphImpl(int[][] costs)
Constructs the graph according to the argument cost matrix. |
|
GraphImpl(int nodes,
int seed,
int maxEdgeWeight)
Constructs a random graph, using seed as the seed for the random number generator. |
|
| Method Summary | |
|---|---|
java.lang.String |
costs2String()
|
int |
getCost(int i,
int j)
Return the distance between nodes whose node numbers are the arguments. |
int[][] |
getCosts()
Returns a symmetric cost matrix. |
int[] |
getMaxCostMaxMatch()
Get the maximum cost maximum matching in the graph. |
int[] |
getMinCostMaxMatch()
Get the minimum cost maximum matching in the graph. |
int |
size()
Get the number of nodes in the graph. |
java.lang.String |
toString()
A string representation of the graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GraphImpl(int nodes,
int seed,
int maxEdgeWeight)
nodes - Number of nodes in the graph.maxEdgeWeight - The maximum edge weight: edge weights are in the
interval [0, maxEdgeWeight).seed - The seed to use for the random number generator.public GraphImpl(int[][] costs)
costs - The cost matrix that is used to construct this graph.| Method Detail |
|---|
public java.lang.String costs2String()
costs2String in interface Graph
public int getCost(int i,
int j)
getCost in interface Graphi - the 1st node number.j - the other node number.
public int[][] getCosts()
getCosts in interface Graphpublic int[] getMinCostMaxMatch()
getMinCostMaxMatch in interface Graphpublic int[] getMaxCostMaxMatch()
getMaxCostMaxMatch in interface Graphpublic int size()
size in interface Graphpublic java.lang.String toString()
toString in interface GraphtoString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||