This package contains the types of graphs that are used in algebraic statistics: Bigraph and MixedGraph.
A bigraph is graph with bidirected edges and no multiple edges. A mixed graph is a graph with undirected, directed and bidirected edges.
This is an example of a bigraph on 4 vertices. It is created using the method bigraph.
i1 : G = bigraph {{3,4},{1,2},{2,4}} o1 = Bigraph{1 => {2} } 2 => {4, 1} 3 => {4} 4 => {3, 2} o1 : Bigraph |
Next is an example of a mixed graph on 4 vertices with undirected, directed and bidirected edges. It is created using the method mixedGraph.
i2 : G = mixedGraph(graph{{1,2}},digraph {{1,3},{2,3}},bigraph {{3,4}}) o2 = MixedGraph{Bigraph => Bigraph{3 => {4}}} 4 => {3} Digraph => Digraph{1 => {3}} 2 => {3} 3 => {} Graph => Graph{1 => {2}} 2 => {1} o2 : MixedGraph |
One can extract key information about mixed graphs using: undirectedGraph(MixedGraph), bigraph(MixedGraph), digraph(MixedGraph), vertices(MixedGraph),
or convert a mixed graph into a more convenient form using: collateVertices(MixedGraph), indexLabelGraph(MixedGraph).
There are several methods that allow to check the properties of mixed graphs: isCyclic(MixedGraph), isLoopless(MixedGraph), isSimple(MixedGraph).
One can also study the properties of vertices using: children(MixedGraph,Thing), parents(MixedGraph,Thing), descendants(MixedGraph,Thing), nondescendants(MixedGraph,Thing), forefathers(MixedGraph,Thing), neighbors(MixedGraph,Thing), nonneighbors(MixedGraph,Thing).
This package allows to construct loopless mixed graphs (LMG) as introduced in Kayvan Sadeghi and Steffen Lauritzen, Markov properties for mixed graphs, Bernoulli 20.2 (2014): 676-696 and to check whether a mixedGraph is an LMG using partitionLMG.
StatGraphs requires Graphs version 0.3.3 or later.
This documentation describes version 0.1 of StatGraphs.
The source code from which this documentation is derived is in the file StatGraphs.m2.
The object StatGraphs is a package.