Learn R Programming

smallstuff (version 1.0.3)

as_adj_def: Create an adjacency matrix from a multigraph according to the definition

Description

Create an adjacency matrix using the definition, i.e. an entry equals 1 if there is an edge from the vertex in the column to the vertex in the row, and cycles are counted twice.

Usage

as_adj_def(g, ...)

Value

Adjacency matrix for graph g

Arguments

g

the graph (an igraph object)

...

additional arguments to be passed to the igraph function as_adj

Examples

Run this code
g=igraph::graph_from_literal(1-2,2-2:3:3:4,3-4:5:6,5-1:1:1,6-6,simplify=FALSE)
as_adj_def(g)

Run the code above in your browser using DataLab