|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.wwu.tobikley.acgc.graphcoloring.ColoredGraph
public class ColoredGraph
Extends any Graph-Implementation with a node- and an edge-coloring.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.uci.ics.jung.utils.UserDataContainer |
|---|
UserDataContainer.CopyAction |
| Field Summary | |
|---|---|
protected int[] |
edgeColoring
The current edge coloring. |
protected HashMap<Edge,Integer> |
edgeIds
Mapping the graphs edges to Integer ids. |
protected HashMap<Integer,Edge> |
edgesById
Mapping the edge ids to the corresponding edges. |
protected Graph |
graph
Graph object all method calls are delegated to. |
protected int[] |
vertexColoring
The current vertex coloring. |
protected HashMap<Vertex,Integer> |
vertexIds
Mapping the graphs vertices to Integer ids. |
protected HashMap<Integer,Vertex> |
verticesById
Mapping the vertice ids to the corresponding vertices. |
| Fields inherited from interface edu.uci.ics.jung.graph.Graph |
|---|
DIRECTED_EDGE, NOT_PARALLEL_EDGE, SIMPLE_EDGE, UNDIRECTED_EDGE |
| Fields inherited from interface edu.uci.ics.jung.graph.ArchetypeGraph |
|---|
SUBSET_MANAGER |
| Constructor Summary | |
|---|---|
ColoredGraph(Graph g)
Creates a new instance of a colored graph. |
|
| Method Summary | |
|---|---|
Edge |
addEdge(Edge e)
|
void |
addListener(GraphEventListener gel,
GraphEventType get)
|
void |
addUserDatum(Object key,
Object datum,
UserDataContainer.CopyAction copyAct)
|
Vertex |
addVertex(Vertex v)
|
Object |
clone()
|
boolean |
containsUserDatumKey(Object key)
|
ColoredGraph |
copy()
|
int |
getColor(Edge edge)
Returns the color of an edge. |
int |
getColor(Vertex vertex)
Returns the color of a vertex. |
Edge |
getEdge(int id)
Returns the edge that corresponds to the given id. |
int |
getEdgeColor(int id)
Returns the color of an edge by its identifier. |
int[] |
getEdgeColoring()
|
Collection |
getEdgeConstraints()
|
int |
getEdgeId(Edge edge)
Returns the edge's identifier. |
Set |
getEdges()
|
Graph |
getGraph()
|
int |
getMaxDegree()
Determines the maximum degree of the graph and returns it. |
Object |
getUserDatum(Object key)
|
UserDataContainer.CopyAction |
getUserDatumCopyAction(Object key)
|
Iterator |
getUserDatumKeyIterator()
|
Vertex |
getVertex(int id)
Returns the vertex that corresponds to the given id. |
int |
getVertexColor(int id)
Returns the color of a vertex by its identifier. |
int[] |
getVertexColoring()
|
Collection |
getVertexConstraints()
|
int |
getVertexId(Vertex vertex)
Returns the vertex's identifier. |
Set |
getVertices()
|
void |
importUserData(UserDataContainer udc)
|
boolean |
isDirected()
Deprecated. |
boolean |
isProperVertexColoring()
Determines if the current vertex coloring is proper. |
boolean |
isRegular()
Determines if the graph is Delta-regular. |
ArchetypeGraph |
newInstance()
|
int |
numEdges()
|
int |
numVertices()
|
void |
removeAllEdges()
|
void |
removeAllVertices()
|
void |
removeEdge(Edge e)
|
void |
removeEdges(Set edges)
Deprecated. |
void |
removeListener(GraphEventListener gel,
GraphEventType get)
|
Object |
removeUserDatum(Object key)
|
void |
removeVertex(Vertex v)
|
void |
removeVertices(Set vertices)
Deprecated. |
void |
setColor(Edge edge,
int color)
Sets the color of an edge. |
void |
setColor(Vertex vertex,
int color)
Sets the color of a vertex. |
void |
setEdgeColor(int id,
int color)
Sets the color of an edge by its identifier. |
void |
setEdgeColoring(int[] edgeColoring)
|
void |
setUserDatum(Object key,
Object datum,
UserDataContainer.CopyAction copyAct)
|
void |
setVertexColor(int id,
int color)
Sets the color of a vertex by its identifier. |
void |
setVertexColoring(int[] vertexColoring)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Graph graph
protected HashMap<Vertex,Integer> vertexIds
protected HashMap<Edge,Integer> edgeIds
protected HashMap<Integer,Vertex> verticesById
protected HashMap<Integer,Edge> edgesById
protected int[] vertexColoring
protected int[] edgeColoring
| Constructor Detail |
|---|
public ColoredGraph(Graph g)
g - Master graph to create a colored copy from.| Method Detail |
|---|
public Edge getEdge(int id)
id - Edge identifier.
public Vertex getVertex(int id)
id - Vertex identifier.
public int getEdgeId(Edge edge)
edge - Edge.
public int getVertexId(Vertex vertex)
vertex - Vertex.
public int getColor(Vertex vertex)
vertex - Vertex.
public int getColor(Edge edge)
edge - Edge.
public int getVertexColor(int id)
id - Vertex's identifier.
public int getEdgeColor(int id)
id - Edge's identifier.
public void setColor(Vertex vertex,
int color)
vertex - Vertex.color - Color to set.
public void setColor(Edge edge,
int color)
edge - Edge.color - Color to set.
public void setVertexColor(int id,
int color)
id - Vertex's identifier.color - Color to set.
public void setEdgeColor(int id,
int color)
id - Edge's identifier.color - Color to set.public boolean isProperVertexColoring()
true if the current vertex coloring is proper, and
false if it is not.public int getMaxDegree()
public boolean isRegular()
true if the graph is regular, and
false if it is not.public Graph getGraph()
public int[] getEdgeColoring()
public void setEdgeColoring(int[] edgeColoring)
edgeColoring - the edgeColoring to setpublic int[] getVertexColoring()
public void setVertexColoring(int[] vertexColoring)
vertexColoring - the vertexColoring to setpublic Edge addEdge(Edge e)
addEdge in interface Graphe -
Graph.addEdge(edu.uci.ics.jung.graph.Edge)
public void addListener(GraphEventListener gel,
GraphEventType get)
addListener in interface ArchetypeGraphgel - get - ArchetypeGraph.addListener(edu.uci.ics.jung.graph.event.GraphEventListener, edu.uci.ics.jung.graph.event.GraphEventType)
public void addUserDatum(Object key,
Object datum,
UserDataContainer.CopyAction copyAct)
addUserDatum in interface UserDataContainerkey - datum - copyAct - UserDataContainer.addUserDatum(java.lang.Object, java.lang.Object, edu.uci.ics.jung.utils.UserDataContainer.CopyAction)public Vertex addVertex(Vertex v)
addVertex in interface Graphv -
Graph.addVertex(edu.uci.ics.jung.graph.Vertex)
public Object clone()
throws CloneNotSupportedException
clone in interface UserDataContainerclone in class ObjectCloneNotSupportedExceptionUserDataContainer.clone()public boolean containsUserDatumKey(Object key)
containsUserDatumKey in interface UserDataContainerkey -
UserDataContainer.containsUserDatumKey(java.lang.Object)public ColoredGraph copy()
copy in interface ArchetypeGraphArchetypeGraph.copy()public Collection getEdgeConstraints()
getEdgeConstraints in interface ArchetypeGraphArchetypeGraph.getEdgeConstraints()public Set getEdges()
getEdges in interface ArchetypeGraphArchetypeGraph.getEdges()public Object getUserDatum(Object key)
getUserDatum in interface UserDataContainerkey -
UserDataContainer.getUserDatum(java.lang.Object)public UserDataContainer.CopyAction getUserDatumCopyAction(Object key)
getUserDatumCopyAction in interface UserDataContainerkey -
UserDataContainer.getUserDatumCopyAction(java.lang.Object)public Iterator getUserDatumKeyIterator()
getUserDatumKeyIterator in interface UserDataContainerUserDataContainer.getUserDatumKeyIterator()public Collection getVertexConstraints()
getVertexConstraints in interface ArchetypeGraphArchetypeGraph.getVertexConstraints()public Set getVertices()
getVertices in interface ArchetypeGraphArchetypeGraph.getVertices()public void importUserData(UserDataContainer udc)
importUserData in interface UserDataContainerudc - UserDataContainer.importUserData(edu.uci.ics.jung.utils.UserDataContainer)public boolean isDirected()
isDirected in interface GraphGraph.isDirected()public ArchetypeGraph newInstance()
newInstance in interface ArchetypeGraphArchetypeGraph.newInstance()public int numEdges()
numEdges in interface ArchetypeGraphArchetypeGraph.numEdges()public int numVertices()
numVertices in interface ArchetypeGraphArchetypeGraph.numVertices()public void removeAllEdges()
removeAllEdges in interface ArchetypeGraphArchetypeGraph.removeAllEdges()public void removeAllVertices()
removeAllVertices in interface ArchetypeGraphArchetypeGraph.removeAllVertices()public void removeEdge(Edge e)
removeEdge in interface Graphe - Graph.removeEdge(edu.uci.ics.jung.graph.Edge)public void removeEdges(Set edges)
removeEdges in interface ArchetypeGraphedges - ArchetypeGraph.removeEdges(java.util.Set)
public void removeListener(GraphEventListener gel,
GraphEventType get)
removeListener in interface ArchetypeGraphgel - get - ArchetypeGraph.removeListener(edu.uci.ics.jung.graph.event.GraphEventListener, edu.uci.ics.jung.graph.event.GraphEventType)public Object removeUserDatum(Object key)
removeUserDatum in interface UserDataContainerkey -
UserDataContainer.removeUserDatum(java.lang.Object)public void removeVertex(Vertex v)
removeVertex in interface Graphv - Graph.removeVertex(edu.uci.ics.jung.graph.Vertex)public void removeVertices(Set vertices)
removeVertices in interface ArchetypeGraphvertices - ArchetypeGraph.removeVertices(java.util.Set)
public void setUserDatum(Object key,
Object datum,
UserDataContainer.CopyAction copyAct)
setUserDatum in interface UserDataContainerkey - datum - copyAct - UserDataContainer.setUserDatum(java.lang.Object, java.lang.Object, edu.uci.ics.jung.utils.UserDataContainer.CopyAction)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||