orca: Orbit counting

Description Usage Arguments Value Author(s) References Examples

Description

Count the node or edge orbits in 4- or 5- node graphlets for all nodes (edges) in the given graph.

Usage

1
2
3
4
count4(graph)
count5(graph)
ecount4(graph)
ecount5(graph)

Arguments

graph

A graph given as a nx2 edge matrix, a data frame with edges or a graph object from the package 'graph'. The nodes in the matrix or data frame are given by integer indices that start with 1.

Value

A numeric matrix or orbit counts. Rows correspond to graph nodes or edges in the same order as on the input, and the columns corresponding to orbits.

Author(s)

Tomaz Hocevar and Janez Demsar

References

Tomaz Hocevar, Janez Demsar (2016): Computation of Graphlet Orbits for Nodes and Edges in Sparse Graphs. Journal of Statistical Software, 71(10), pp. 1-24.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library(orca)

# Load and show the orbit counts for the Karate graph
data("karate")
count4(karate)


## Not run: 
# Simple analysis of School Wikipedia network: find the most similar
# nodes with respect to the local network topology
# Requires data from http://www.biolab.si/supp/Rorca/_downloads/schools-wiki.zip

library("FNN")

nodes <- scan("schools-wiki-nodes.txt", what="", sep="\n")
edges <- read.table("schools-wiki-edges.txt")

orbits <- count4(edges)
nn <- get.knn(orbits, k=10)
neighbours <- nn$nn.index
distances <- nn$nn.dist

check <- c("Canada", "Germany", "Isaac Newton", "Albert Einstein",
           "Mahatma Gandhi", "Mahabharata")
node_indices <- match(check, nodes)
for (i in 1:length(check)) {
    cat("\n\n", check[i], ": ", sep="")
    cat(nodes[neighbours[node_indices[i], ]], sep=", ")
    cat("\n")
    cat(round(distances[node_indices[i], ]), sep=", ")
}

## End(Not run)

orca documentation built on May 2, 2019, 7:03 a.m.

Related to orca in orca...