Skip to main content

Ranked Graphs

Encoding a Bigraph to a Ranked Graph​

In some cases, bigraphs may be casted to ranked graphs, as defined in [1], by exploiting the proposed encoding approach described in [2].

The next listing shows how to encode the bigraph depicted below to a ranked graph.

imgs This bigraph is taken from [2].

PureBigraph bigraph = ...;
PureBigraphRankedGraphEncoding graphEncoding = new PureBigraphRankedGraphEncoding(bigraph);
graphEncoding.encode();
Graph<AbstractRankedGraph.LabeledNode, AbstractRankedGraph.LabeledEdge> graph = graphEncoding.getGraph();

Internally, an object of class org.jgrapht.Graph<V, E> is created because JGraphT is used to represent the structure of the ranked graph. The graph is an unweighted directed graph allowing multiple edges and refusing self-loops.

The encoded bigraph as ranked graph is illustrated below.

imgs

The graphical file is provided by the visualization module of this framework using the BigraphRankedGraphExporter.

References​