Since the intergraph hyperedge has sources
and targets in different hypergraphs, the question arises in which
hypergraph the hyperedge is stored. As for intergraph links, an
intergraph hyperedge must be stored in the first common ancestor of
all its end nodes.
![diahyp_interedge_hyperhierarchy.gif](../usrhyperdiag/_media/diahyp_interedge_hyperhierarchy_default.gif)
Intergraph hyperedge in a hierarchy of
hypergraphs
In the above figure, the red intergraph
hyperedge that connects the objects of A and B must be stored in
hypergraph C, the first common ancestor of A and B.
The IlvHyperGrapher class provides a
static utility method that allows you to determine the first common
hypergraph:
static IlvHyperGrapher getLowestCommonHyperGrapher(IlvHyperEdge edge)
The following code example shows how to
create an intergraph hyperedge.
Creating an intergraph hyperedge
... IlvHyperEdge edge = new IlvHyperEdge(fromNodes, toNodes); IlvHyperGrapher common = IlvHyperGrapher.getLowestCommonHyperGrapher(edge); common.addHyperEdge(edge, false);
The static utility method IlvHyperGrapher.addInterGraphHyperEdge
allows you to add the edge directly to the common parent
hypergraph. Therefore, this code example can be shortened as
follows:
Short code for creating an intergraph
hyperedge
... IlvHyperEdge edge = new IlvHyperEdge(fromNodes, toNodes); IlvHyperGrapher.addInterGraphHyperEdge(edge, false);