# Function Repository Resource:

# BranchialHypergraph

Compute the branchial hypergraph of a graph

Contributed by: Nikolay Murzin
 ResourceFunction["BranchialHypergraph"][g] computes the branchial hypergraph of a graph g.

## Details

A branchial hypergraph consists of ordered hyperedges encoding the ancestry degree of separation between an initial vertex and other vertices. For example, hyperedge {a,b,c,d} means that vertices a and b have an immediate common ancestor, a and c have a common ancestor of degree 2 (an ancestor at maximum distance of 2 from both a and c), and vertices a and d have a common ancestor of degree 3.
Vertices without any branchpairs will result in an unary hyperedge.

## Examples

### Basic Examples (3)

Compute branchial hyperedges of a simple graph:

 In:= Out= Branchial hypergraph of a mixed graph:

 In:= Out= The branchial hypergraph of any undirected graph is trivial:

 In:= Out= ### Scope (2)

Make a branchial hypergraph for a simple string substitution multiway system:

 In:= Out= Display the branchial hypergraph using an Echo while plotting the graph:

 In:=  Out= ### Properties and Relations (1)

Usually the branchial graph can be recovered from the hypergraph by taking the first two vertices from each hyperedge:

 In:= Out= 