|
|||||||||
| 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.GraphEuclidean
public final class GraphEuclidean
| Field Summary | |
|---|---|
static int |
METRIC_EUC_2D
|
static int |
METRIC_GEO
|
| Constructor Summary | |
|---|---|
GraphEuclidean(int $nodes,
int seed,
int magnification)
Constructs a random graph, using seed as the seed for the random number generator. |
|
GraphEuclidean(int $nodes,
int metric,
java.lang.String name,
java.lang.String description)
|
|
| Method Summary | |
|---|---|
java.lang.String |
costs2String()
|
void |
drawCappello2Approximation(java.awt.Graphics g,
int x,
int y,
int extent)
|
void |
drawMatching(java.awt.Graphics g,
int x,
int y,
int extent)
Draw a minimum cost maximum matching of this graph. |
void |
drawTour(java.awt.Graphics g,
int x,
int y,
int extent)
|
void |
drawVertices(java.awt.Graphics g,
int x,
int y,
int extent)
Draw the vertices in a square of extent X extent pixels, starting at pixel offset (x, y) on Graphics g. |
java.lang.String |
getComment()
|
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 |
getMetric()
|
int[] |
getMinCostMaxMatch()
Get the minimum cost maximum matching in the graph. |
java.lang.String |
getName()
|
int[] |
getTour(int[] tour)
|
static void |
main(java.lang.String[] args)
|
void |
setComment(java.lang.String value)
|
void |
setMetric(int value)
|
void |
setName(java.lang.String value)
|
void |
setTour(int[] tour)
|
void |
setVertex(int index,
edu.ucsb.cs.jicos.applications.utilities.graph.Vertex vert)
|
int |
size()
Get the number of nodes in the graph. |
java.lang.String |
toString()
Get a string representation of the graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int METRIC_GEO
public static final int METRIC_EUC_2D
| Constructor Detail |
|---|
public GraphEuclidean(int $nodes,
int seed,
int magnification)
$nodes - Number of nodes in the graph.seed - The seed to use for the random number generator.magnification - The magnification factor. For example, if the x coordinate of a vertex
is 0.76543 and the magnification is 1000, then the magnified x coordinate
is 765 and the unit square maps to a 1000 X 1000 int grid.
public GraphEuclidean(int $nodes,
int metric,
java.lang.String name,
java.lang.String description)
| Method Detail |
|---|
public void setVertex(int index,
edu.ucsb.cs.jicos.applications.utilities.graph.Vertex vert)
public void setMetric(int value)
public int getMetric()
public void setName(java.lang.String value)
public java.lang.String getName()
public void setComment(java.lang.String value)
public java.lang.String getComment()
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 Graph
public void drawMatching(java.awt.Graphics g,
int x,
int y,
int extent)
g - The Graphics object on which the drawing takes place.x - The horizontal offset.y - The vertical offset.extent - The edge length, in pixels, of the square containing the drawing.
public void drawCappello2Approximation(java.awt.Graphics g,
int x,
int y,
int extent)
public void drawTour(java.awt.Graphics g,
int x,
int y,
int extent)
public void drawVertices(java.awt.Graphics g,
int x,
int y,
int extent)
g - The graphics object on which the drawing is to take place.x - The horizontal offset in pixels.y - The vertical offset in pixels.extent - The edge length, in pixels, of a square region containing the set of nodes.public int[] getTour(int[] tour)
public void setTour(int[] tour)
public java.lang.String toString()
Graph
toString in interface GraphtoString in class java.lang.Objectpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||