drasys.or.graph.color
Interface ColoringI

All Known Implementing Classes:
WelshPowell

public interface ColoringI

The interface used by all algorithms to access graph coloring algorithms. These algorithms color the vertices and/or edges of a graph such that no two adjacent elements are the same color.

See Also:
WelshPowell

Method Summary
 int colorEdges()
          Colors the edges of the graph.
 int colorVertices()
          Colors the vertices of the graph.
 int getEdgeColor(EdgeI edge)
          Returns the color assigned to the edge.
 int[] getEdgeColors()
          Returns an array containing the edge color assignments.
 int getVertexColor(VertexI vertex)
          Returns the color assigned to the vertex.
 int[] getVertexColors()
          Returns an array containing the vertex color assignments.
 int sizeOfEdgeColors()
          Returns the number of unique colors used to color the edges.
 int sizeOfVertexColors()
          Returns the number of unique colors used to color the vertices.
 

Method Detail

colorVertices

public int colorVertices()
Colors the vertices of the graph. The colors are numbered sequentially starting at zero
Returns:
the number of unique colors used.

colorEdges

public int colorEdges()
Colors the edges of the graph. The colors are numbered sequentially starting at zero
Returns:
the number of unique colors used.

sizeOfVertexColors

public int sizeOfVertexColors()
                       throws GraphException
Returns the number of unique colors used to color the vertices.
Throws:
GraphException - if the edges have not been colored.
InvalidGraphError - if the graph has changed since the vertices were colored.

sizeOfEdgeColors

public int sizeOfEdgeColors()
                     throws GraphException
Returns the number of unique colors used to color the edges.
Throws:
GraphException - if the edges have not been colored.
InvalidGraphError - if the graph has changed since the edges were colored.

getVertexColor

public int getVertexColor(VertexI vertex)
                   throws GraphException
Returns the color assigned to the vertex.
Throws:
GraphException - if the vertices have not been colored.
GraphError - if the vertex is not owned by the graph.
InvalidGraphError - if the graph has changed since the vertices were colored.

getEdgeColor

public int getEdgeColor(EdgeI edge)
                 throws GraphException
Returns the color assigned to the edge.
Throws:
GraphException - if the edges have not been colored.
GraphError - if the edge is not owned by the graph.
InvalidGraphError - if the graph has changed since the edges were colored.

getVertexColors

public int[] getVertexColors()
                      throws GraphException
Returns an array containing the vertex color assignments. The colors are sequentially numbered starting at zero.
Returns:
an integer array indexed by VertexI.getIndex().
Throws:
GraphException - if the vertices have not been colored.
InvalidGraphError - if the graph has changed since the vertices were colored.

getEdgeColors

public int[] getEdgeColors()
                    throws GraphException
Returns an array containing the edge color assignments. The colors are sequentially numbered starting at zero.
Returns:
an integer array indexed by EdgeI.getIndex().
Throws:
GraphException - if the edges have not been colored.
InvalidGraphError - if the graph has changed since the edges were colored.


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com