public class PathDecomposition
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PathDecomposition.TestData
This class represents the result of checking whether a path decomposition
is really a path decomposition of a graph.
|
static class |
PathDecomposition.TestResult |
Constructor and Description |
---|
PathDecomposition() |
Modifier and Type | Method and Description |
---|---|
void |
addBag(java.util.Set<Node> bag)
Adds a new bag to the end of this PathDecomposition.
|
java.util.Set<Node> |
getBag(int index)
Returns the bag at a specified index.
|
int |
getNumOfBags()
Returns the number of bags in this path decomposition.
|
int |
getWidth()
Returns the width of this path decomposition.
|
PathDecomposition.TestData |
testGraph(Graph graph)
Tests whether this PathDecomposition is a legal path decomposition
for a given graph.
|
public void addBag(java.util.Set<Node> bag)
bag
- the bag to be added to this PathDecompositionpublic java.util.Set<Node> getBag(int index)
index
- the index of the bag to be returnedpublic int getNumOfBags()
public int getWidth()
public PathDecomposition.TestData testGraph(Graph graph)
This method returns a TestData
object which describes the
result of the test. If this is a path decomposition of graph
,
this.testGraph(graph).isOkay()
return true
.
Otherwise the returned TestData
contains information about
the reason that this is not a path decomposition for graph
.
graph
- the graph to testTestData
object which describes the
result of the test