public class CospanDecomposition extends Object implements Decomposition<Operation>, Iterable<Operation>
Decomposition.Type
Constructor and Description |
---|
CospanDecomposition()
Creates a new (empty) cospan decomposition with an empty left interface.
|
CospanDecomposition(CospanDecomposition decomposition)
Creates a new cospan decomposition by copying the cospan decomposition
decomposition . |
CospanDecomposition(int initialWidth)
Creates a new (empty) cospan decomposition with the discrete graph with
width nodes
as inner and outer interface. |
CospanDecomposition(int width,
List<Operation> operationList)
Creates a cospan decomposition from the list
operationList of operations with a left
interface of width width . |
CospanDecomposition(List<Operation> operationList)
Creates a cospan decomposition from the list
operationList of operations with an empty
left interface. |
Modifier and Type | Method and Description |
---|---|
void |
add(CospanDecomposition decomposition)
Adds the cospan decomposition
decomposition (seen as a list of operations) to this graph. |
void |
add(Operation operation)
Appends an operation at the end of this cospan decomposition.
|
void |
addAll(List<Operation> list)
Appends all letters of the list
list at the end of this cospan decomposition. |
boolean |
equals(Object o) |
Operation |
get(int index)
Returns the
index -th operation of the cospan decomposition. |
static CospanDecomposition |
getCospanDecomposition(GraphDecomposition decomposition)
Returns a cospan decomposition created from the graph decomposition
decomposition |
static CospanDecomposition |
getCospanDecomposition(PathDecomposition pathDecomposition)
Returns a cospan decomposition created from the path decomposition
decomposition |
static CospanDecomposition |
getCospanDecomposition(TreeDecomposition decomposition)
Returns a cospan decomposition created from the tree decomposition
decomposition |
Graph |
getGraph()
Returns the graph which can be obtained from this cospan decomposition.
|
List<Node> |
getInnerInterface()
Returns a list of the nodes in the inner interface of this decomposition.
|
int |
getInnerInterfaceSize()
Returns the size of the inner interface (of the cospan) of this decomposition.
|
List<String> |
getInterfaceNodeNames()
Returns a list of the names of the nodes in the interface.
|
int |
getLength()
Returns the length of this decomposition, i.e. the number of
bags of this decomposition.
|
int |
getNodeCounter()
Returns the node count of this decomposition.
|
List<Operation> |
getOperations()
Returns the list of operations used for this cospan decomposition
|
List<Node> |
getOuterInterface()
Returns a list of the nodes in the outer interface of this decomposition.
|
int |
getOuterInterfaceSize()
Returns the size of the outer interface (of the cospan) of this decomposition.
|
Signature |
getSignature()
Returns the underlying signature of this cospan decomposition
|
Decomposition.Type |
getType()
Returns the type of the data object.
|
int |
getWidth()
Returns the overall width of this decomposition, i.e. the size of the
largest interface of this decomposition.
|
int |
hashCode() |
boolean |
isApplicable(Operation operation)
Returns
true if and only if the operation operation can be added
to this cospan decomposition. |
boolean |
isEmpty()
Returns
true if and only if the decomposition is empty, i.e. it has the length zero. |
Iterator<Operation> |
iterator() |
String |
toString() |
public CospanDecomposition(int initialWidth)
width
nodes
as inner and outer interface.initialWidth
- the initial width of the cospan decomposition and the inner and outer interfacepublic CospanDecomposition()
public CospanDecomposition(CospanDecomposition decomposition)
decomposition
.decomposition
- the cospan decomposition to be copiedpublic CospanDecomposition(List<Operation> operationList)
operationList
of operations with an empty
left interface.operationList
- the operation listpublic CospanDecomposition(int width, List<Operation> operationList)
operationList
of operations with a left
interface of width width
.width
- the initial width of the cospan decomposition and the left interfaceoperationList
- the operation listpublic static CospanDecomposition getCospanDecomposition(GraphDecomposition decomposition)
decomposition
decomposition
- the original path decompositionpublic static CospanDecomposition getCospanDecomposition(TreeDecomposition decomposition)
decomposition
decomposition
- the original path decompositionpublic static CospanDecomposition getCospanDecomposition(PathDecomposition pathDecomposition)
decomposition
pathDecomposition
- the original path decompositionpublic void add(Operation operation) throws UnsupportedOperationException
operation
- the new operationUnsupportedOperationException
- thrown if the operation can not be applied to this decompositionpublic void add(CospanDecomposition decomposition) throws UnsupportedOperationException
decomposition
(seen as a list of operations) to this graph.decomposition
- the cospan decomposition to be appliedUnsupportedOperationException
- thrown if the at least one operation of the cospan
decomposition can not be applied to this graphpublic void addAll(List<Operation> list)
list
at the end of this cospan decomposition.list
- the list of letters to be addedpublic List<Operation> getOperations()
public Operation get(int index)
index
-th operation of the cospan decomposition.index
- the index of the operationindex
-th operationpublic Signature getSignature()
public Graph getGraph()
public int getWidth()
Decomposition
getWidth
in interface Decomposition<Operation>
public int getInnerInterfaceSize()
public int getOuterInterfaceSize()
public int getNodeCounter()
public boolean isEmpty()
Decomposition
true
if and only if the decomposition is empty, i.e. it has the length zero.isEmpty
in interface Decomposition<Operation>
true
if the decomposition is empty, false
otherwisepublic int getLength()
Decomposition
getLength
in interface Decomposition<Operation>
public List<String> getInterfaceNodeNames()
public List<Node> getInnerInterface()
public List<Node> getOuterInterface()
public boolean isApplicable(Operation operation)
true
if and only if the operation operation
can be added
to this cospan decomposition.operation
- the operation to be addedtrue
if the operation can be added, false
otherwiseadd(Operation)
,
add(CospanDecomposition)
public Decomposition.Type getType()
Data