public static class GraphUtil.ColoredGraph
extends java.lang.Object
GraphUtil.toColoredGraph(Graph)
Modifier and Type | Field and Description |
---|---|
private java.util.Collection<java.util.List<java.lang.Integer>> |
colorMap
A collection of lists where each list has the
IDs of nodes with the same colour.
|
private int[][] |
graph
The adjacency list representing the graph.
|
Modifier | Constructor and Description |
---|---|
private |
ColoredGraph(int[][] adj,
java.util.Collection<java.util.List<java.lang.Integer>> colors)
Constructs a new coloured graph with the given
adjacency list and colour information.
|
Modifier and Type | Method and Description |
---|---|
int[][] |
getAdjacencyList()
Gets the adjacency list representation of this graph.
|
java.util.Collection<java.util.List<java.lang.Integer>> |
getColorMap()
Gets the colour map for this coloured graph, each
list in the returned collection contains the IDs
of nodes with the same colour.
|
int |
getNodeCount()
Gets the total number of nodes in this graph.
|
private int[][] graph
private java.util.Collection<java.util.List<java.lang.Integer>> colorMap
private ColoredGraph(int[][] adj, java.util.Collection<java.util.List<java.lang.Integer>> colors)
adj
- The adjacency list of the graph.colors
- The colour information.public int getNodeCount()
public java.util.Collection<java.util.List<java.lang.Integer>> getColorMap()
public int[][] getAdjacencyList()