When using IncMaxCliqueAdapter, trying to find a clique on a graph with a single node causes an IndexOutOfBoundsException to be thrown:
In the following error output, neighboringNodesGraph is the graph that is being passed into findMaxClique(). To fix, check the size of the graph at the beginning of findMaxClique(). Only run the algorithm if the size is >=2. By definition, the Max Clique of a graph of size one is that single node, and the Max Clique of a graph of size zero is an empty graph.
Size of neighboringNodesGraph: 1
Reading input from IncMaxCliqueProcess
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -3
at java.util.ArrayList.elementData(ArrayList.java:418)
at java.util.ArrayList.get(ArrayList.java:431)
at com.aaronpmaus.jMath.graph.IncMaxCliqueAdapter.findMaxClique(IncMaxCliqueAdapter.java:100)
at com.aaronpmaus.jMath.graph.IncMaxCliqueAdapter.findMaxClique(IncMaxCliqueAdapter.java:49)
at com.aaronpmaus.jProt.metrics.Metrics.getNeighborhood(Metrics.java:348)
at com.aaronpmaus.jProt.metrics.Metrics.getGlobalDistanceRegions(Metrics.java:295)
at com.aaronpmaus.jProt.executables.JProtMetrics.globalDistanceTest(JProtMetrics.java:280)
at com.aaronpmaus.jProt.executables.JProtMetrics.main(JProtMetrics.java:199)