harpoon.Analysis.GraphColoring
Class GraphColorer
java.lang.Object
harpoon.Analysis.GraphColoring.GraphColorer
- Direct Known Subclasses:
- OptimisticGraphColorer, SimpleGraphColorer, UnboundedGraphColorer
public abstract class GraphColorer
- extends Object
GraphColorer
is a class for describing a graph coloring
algorithm.
- Version:
- $Id: GraphColorer.java,v 1.2 2002/02/25 20:57:17 cananian Exp $
- Author:
- Felix S. Klock II <pnkfelix@mit.edu>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GraphColorer
public GraphColorer()
- Creates a
GraphColorer
.
color
public abstract void color(ColorableGraph graph,
List colors)
throws UnableToColorGraph
- Attempts to color
graph
.
requires:
-
colors
is a List
of
Color
s.
-
graph
does not have any hidden nodes.
modifies: graph
effects: Attempts to color graph
using the set of Color
s given in
colors
. If successful, every node in
graph
will be present in
graph
's Node -> Color mapping, with no two
interfering nodes sharing the same color.
- Throws:
UncolorableGraph
- A coloring cannot be found
for graph
. graph
may be left
with some hidden nodes and an non-empty Node -> Color
mapping, but can be returned to its original state with a
call to graph.resetGraph()
.
UnableToColorGraph