public class GraphFactory
extends java.lang.Object
Graph
and InterfaceGraph
objects.Modifier and Type | Method and Description |
---|---|
static Graph |
createCompleteGraph(int numOfNodes,
Label label)
Creates a new complete graph.
|
static Graph |
createCompleteGraph(int numOfNodes,
Label label,
boolean loops)
Creates a new complete graph.
|
static InterfaceGraph |
createConnect(int ifsize,
Label label)
Creates a new interface graph which corresponds to the "connect"
atomic operation.
|
static InterfaceGraph |
createConnect(int ifsize,
Label label,
java.util.List<java.lang.Integer> attach)
Creates a new interface graph which corresponds to the "connect"
atomic operation.
|
static Graph |
createCycleGraph(int numOfNodes,
Label label)
Creates a new cycle graph.
|
static Graph |
createDiscreteGraph(int numOfNodes)
Creates a new discrete graph.
|
static Graph |
createFlowerGraph(java.util.Collection<Label> signature)
Creates a flower graph of a given signature.
|
static InterfaceGraph |
createIdentity(int ifsize)
Creates a new interface graph which represents the identity operation.
|
static Graph |
createPathGraph(int numOfNodes,
Label label)
Creates a new path graph.
|
static Graph |
createRandomGraphWithPathWidth(int numOfNodes,
double density,
int pathWidth,
java.util.Set<Label> sig)
Creates a new random graph of which the path width will not exceed
a given bound.
|
static InterfaceGraph |
createRestrict(int ifsize)
Creates an interface graph which corresponds to the "restrict" atomic
operation, which removes a single node from the interface.
|
static InterfaceGraph |
createRestrict(int ifsize,
int nodes)
Creates an interface graph which corresponds to the "restrict" atomic
operation, which removes a number of nodes from the interface.
|
static InterfaceGraph |
createVertex(int ifsize)
Creates a new interface graph which represents the vertex operation.
|
static InterfaceGraph |
createVertex(int ifsize,
int newNodes)
Creates a new interface graph which represents the vertex operation.
|
public static Graph createDiscreteGraph(int numOfNodes)
numOfNodes
- the number of nodes in the new graphnumOfNodes
nodespublic static Graph createCompleteGraph(int numOfNodes, Label label, boolean loops)
numOfNodes
nodes and an edge with the
specified label (which must be binary) between each pair of nodes.
If the boolean argument loops
is false
, then no
loops are added, that is, no edges are added between each node and
itself.numOfNodes
- number of nodes in the new graphlabel
- label of all the edges in the graph; the label must be binary, that
is label.getArity() == 2
loops
- if true
, the returned graph also contains loopsnumOfNodes
nodespublic static Graph createCompleteGraph(int numOfNodes, Label label)
numOfNodes
nodes and an edge with the
specified label (which must be binary) between each pair of nodes.
The method call createCompleteGraph(non, l)
is equivalent to
the method call createCompleteGraph(non, l, true)
.
numOfNodes
- number of nodes in the new graphlabel
- label of all the edges in the graph; the label must be binary, that
is label.getArity() == 2
numOfNodes
nodes#createCompleteGraph(int,Label,int)
public static Graph createCycleGraph(int numOfNodes, Label label)
numOfNodes
- the number of nodes in the new graphlabel
- label of all the edges in the graph; the label must be binary, that
is label.getArity() == 2
numOfNodes
nodespublic static Graph createPathGraph(int numOfNodes, Label label)
numOfNodes
- the number of nodes in the new graphlabel
- label of all the edges in the graph; the label must be binary, that
is label.getArity() == 2
numOfNodes
nodespublic static Graph createFlowerGraph(java.util.Collection<Label> signature)
signature
- signature for which a flower graph is createdpublic static Graph createRandomGraphWithPathWidth(int numOfNodes, double density, int pathWidth, java.util.Set<Label> sig)
The new graph has numOfNodes
nodes and
at least density
* numOfNodes
2 edges.
Edge labels are randomly selected from a given set of possible
edge labels.
The given signature sig
may not contain labels of arity 0.
numOfNodes
- number of nodes in the new graphdensity
- density of the new graphpathWidth
- path width of the new graphsig
- set of label which can occur in the new graphjava.lang.IllegalArgumentException
- when sig
contains labels of
arity 0public static InterfaceGraph createIdentity(int ifsize)
ifsize
- interface size of the new interface graphifsize
public static InterfaceGraph createVertex(int ifsize, int newNodes)
ifsize
- inner interface size of the new interface graphnewNodes
- number of nodes which is added by the new interface graphifSize
that adds newNodes
new
nodespublic static InterfaceGraph createVertex(int ifsize)
The method call createVertex(n)
is equivalent to
createVertex(n, 1)
.
ifsize
- inner interface size of the new interface graphifSize
that adds a new nodepublic static InterfaceGraph createConnect(int ifsize, Label label, java.util.List<java.lang.Integer> attach)
This form of the method allows to specify exactly how the new edge is to
be attached to the interface nodes by using the attach
parameter. The nth integer in this list specifies the index within
the outer interface of the nth node attached to the new edge.
ifsize
- size of the inner interface of the new interface graphlabel
- label of the edge to be addedattach
- attachment informationpublic static InterfaceGraph createConnect(int ifsize, Label label)
This form of the method produces an interface graph which attaches the new edge to the first nodes of the outer interface.
ifsize
- size of the inner interface of the new interface graphlabel
- label of the edge to be addedpublic static InterfaceGraph createRestrict(int ifsize, int nodes)
ifsize
- interface size of the new operationnodes
- number of nodes that are removed by the operationpublic static InterfaceGraph createRestrict(int ifsize)
ifsize
- interface size of the new operation