public class GraphManipulation
extends java.lang.Object
| Constructor and Description |
|---|
GraphManipulation() |
| Modifier and Type | Method and Description |
|---|---|
static Graph |
addLeavesV2(Graph graph)
After that the triangulation of the moral graph have been performed and a tree which have the cliques of the triangulated moral
graph as node have been created, the GDL algorithm state that the old local domain must now been add to the created tree.
|
static java.util.List<JunctionTreeCell> |
convertSpanningTreeIntoJunctionTree(Graph spanningTree)
If the maximal weight spanning tree is a junction tree this method will convert the data format of it.
|
static void |
createEdge(Vertex VertexA,
Vertex VertexB,
Variable labelVariable,
java.util.ArrayList<Edge> listEdge)
This method is used for creating the edge between the vertices for the
local domain graph and for the maximun weight spanning tree.
|
static Graph |
CreateEdgesInLocalDomainGraph(Graph vertexLocalDomainGraph)
In the "The Generalized Distributive Law" of Aji & McEliece the local
domain graph is defined as follow :
The local domain graph is a weighted complete graph with M vertices
V1, ..., Vm, one for each local domain, with the weight of the edge
defined by : Wi,j = |Si Union Sj|
[ See the "The Generalized Distributive Law" of Aji & McEliece,]
This method create this local domain graph, the created graph is
available in two fields :
- 'listVertex' for the list of the vertex
- 'listEdgeDomainGraph' for the edges
|
static Graph |
createGraphAfterTriangulate(java.util.List<java.util.List<MoralGraphCell>> listClique)
This method is here to create a graph after the triangulation of the moral graph.
|
static Graph |
createMaximalSpanningTree(Graph graph)
The goal of the local domain graph is to create the maximal weight
spanning tree [ See the "The Generalized Distributive Law" of Aji
& McEliece].
|
static java.util.List<MoralGraphCell> |
createMoralGraph()
This method create the moral graph please see the Chapter III of the
"The Generalized Distributive Law" of Aji & McEliece.
|
static void |
directJunctionTree(JunctionTreeCell cell)
In the case of the single vertex problem the tree must be directed toward one vertex in order to allow the message passing algorithm to works.
|
static Graph |
mergeNonAffectedCell(Graph graph)
This method is the instantiation of a solution that I present in my master Report.
|
static Graph |
putLocalDomainInGraph()
This method is simply use in order to put all the local domain in vertex.
|
static void |
setFather(JunctionTreeCell current,
JunctionTreeCell father)
This method is used when a junction tree must be directed.
|
static boolean |
spanningTreeIsJunctionTree(Graph spanningTree)
This method calculate if the maximal weight spanning tree in parameter is a junction tree.
|
static java.util.List<java.util.List<MoralGraphCell>> |
triangulateMoralGraph(java.util.List<MoralGraphCell> moralgraph)
In order to transform the moral graph into a junction tree the first step
is to convert the undirected moral graph into a triangulated moral graph.
|
public static Graph putLocalDomainInGraph()
public static Graph CreateEdgesInLocalDomainGraph(Graph vertexLocalDomainGraph)
public static Graph createMaximalSpanningTree(Graph graph)
public static boolean spanningTreeIsJunctionTree(Graph spanningTree)
spanningTree - the maximal weight spanning tree which must be evaluatedpublic static java.util.List<JunctionTreeCell> convertSpanningTreeIntoJunctionTree(Graph spanningTree)
spanningTree - the maximal spanning tree which have successfully pass the test an which must be convertedpublic static void directJunctionTree(JunctionTreeCell cell)
cell - the cell toward which must be oriented the treepublic static void setFather(JunctionTreeCell current, JunctionTreeCell father)
current - the cell which must be set a childfather - the father of the cell pass in first parameterpublic static void createEdge(Vertex VertexA, Vertex VertexB, Variable labelVariable, java.util.ArrayList<Edge> listEdge)
VertexA - The fisrt vertex of the edge ( please note that the egdes
are undirected and so which one is the first and which is the second
doesn't matter )VertexB - The second vertex of the edge ( please note that the egdes
are undirected and so which one is the first and which is the second
doesn't matter )labelVariable - For the local domain graph the link is over a specific
variable label this one must be specified ( in the case of the maximal
weight spanning tree where the link do not depend od a variable just
pass 'null' )listEdge - The current list of existing edge for the wanted graph in
order to spare any double edgepublic static java.util.List<MoralGraphCell> createMoralGraph()
public static java.util.List<java.util.List<MoralGraphCell>> triangulateMoralGraph(java.util.List<MoralGraphCell> moralgraph)
public static Graph createGraphAfterTriangulate(java.util.List<java.util.List<MoralGraphCell>> listClique)
listClique - public static Graph addLeavesV2(Graph graph)
graph - The created graphpublic static Graph mergeNonAffectedCell(Graph graph)
graph - The graph that will become a junction tree