Class Nauty.ColoredGraph

java.lang.Object
dev.roanh.cpqindex.Nauty.ColoredGraph
Enclosing class:
Nauty

public static class Nauty.ColoredGraph extends Object
Represents a coloured graph. Colours are assigned to 4 categories in this graph:
  1. Each label is represented by a colour.
  2. The source vertex is represented by a colour.
  3. The target vertex is represented by a colour unless the target vertex equals the source vertex.
  4. Any remaining vertices are represented by a colour if any.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int[][]
    The adjacency list representing the graph.
    private List<Map.Entry<dev.roanh.gmark.core.graph.Predicate,int[]>>
    A collection of lists where each list has the IDs of nodes with the same colour.
    private int[]
    List of node IDs that have no label.
    private int
    The ID of the source vertex of the graph.
    private int
    The ID of the target vertex of the graph.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColoredGraph(int[][] adj, int source, int target, List<Map.Entry<dev.roanh.gmark.core.graph.Predicate,int[]>> labels, int[] nolabel)
    Constructs a new coloured graph with the given adjacency list and colour information.
  • Method Summary

    Modifier and Type
    Method
    Description
    int[][]
    Gets the adjacency list representation of this graph.
    List<int[]>
    Gets the colour information of this graph as a list of lists where each list has the IDs of vertices of the same colour.
    List<Map.Entry<dev.roanh.gmark.core.graph.Predicate,int[]>>
    Gets a list of colour information in the form of a list of entries where each entry has the colour label and IDs of vertices with that colour.
    int
    Gets the total number of nodes in this graph.
    int[]
    Gets the IDs of nodes without a label/colour.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • graph

      private int[][] graph
      The adjacency list representing the graph.
    • labels

      private List<Map.Entry<dev.roanh.gmark.core.graph.Predicate,int[]>> labels
      A collection of lists where each list has the IDs of nodes with the same colour. The label for the colour is also present in each entry. Excludes the special collection of nodes without label. The list items are sorted on predicate ID.
    • noLabel

      private int[] noLabel
      List of node IDs that have no label.
    • source

      private int source
      The ID of the source vertex of the graph.
    • target

      private int target
      The ID of the target vertex of the graph.
  • Constructor Details

    • ColoredGraph

      public ColoredGraph(int[][] adj, int source, int target, List<Map.Entry<dev.roanh.gmark.core.graph.Predicate,int[]>> labels, int[] nolabel)
      Constructs a new coloured graph with the given adjacency list and colour information.
      Parameters:
      adj - The adjacency list of the graph.
      source - The node ID of the source vertex of the graph.
      target - The node ID of the target vertex of the graph.
      labels - A list of node IDs for each label.
      nolabel - A list of node IDs without any label.
  • Method Details

    • getNodeCount

      public int getNodeCount()
      Gets the total number of nodes in this graph.
      Returns:
      The total number of nodes in this graph.
    • getNoLabels

      public int[] getNoLabels()
      Gets the IDs of nodes without a label/colour.
      Returns:
      The IDs of nodes without a label/colour.
    • getLabels

      public List<Map.Entry<dev.roanh.gmark.core.graph.Predicate,int[]>> getLabels()
      Gets a list of colour information in the form of a list of entries where each entry has the colour label and IDs of vertices with that colour.
      Returns:
      Gets the IDs of the coloured vertices and labels.
    • getColorLists

      public List<int[]> getColorLists()
      Gets the colour information of this graph as a list of lists where each list has the IDs of vertices of the same colour.
      Returns:
      The colour information as a list of lists.
    • getAdjacencyList

      public int[][] getAdjacencyList()
      Gets the adjacency list representation of this graph.
      Returns:
      The adjacency list representation of this graph.