a1rk: Rank of the A-1 homotopy group of a graph

Description Usage Arguments Examples

Description

Calculate the rank (the number of homotopy-inequivalent cycles) of the first discrete homotopy group of a graph.

Usage

1
a1rk(graph, componentwise = FALSE)

Arguments

graph

The input graph. It will be treated as simple and undirected. A submodule handles the case that graph is connected, and a wrapper feeds this submodule the connected components of graph.

componentwise

Logical, defaults to false. If true, returns a vector of the A-1 ranks of the connected components of graph. If false, returns the A-1 rank of graph, which is the sum of these ranks.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# cycle graph
g <- graph(c(1,2, 2,3, 3,4, 4,5, 5,1), directed = FALSE)
a1rk(g)

# two-cycle graph
h <- add_vertices(g, 4)
h <- add_edges(h, c(2,6, 6,7, 7,8, 8,9, 9,1))
a1rk(h)

# Platonic solids
a1rk(graph.famous("tetrahedron"))
a1rk(graph.famous("cubical"))
a1rk(graph.famous("dodecahedron"))

corybrunson/atheory documentation built on May 13, 2019, 10:51 p.m.