graph2m: Deriving an adjacency matrix of a graph

View source: R/graphhelpfns.R

graph2mR Documentation

Deriving an adjacency matrix of a graph

Description

This function derives the adjacency matrix corresponding to a graph object

Usage

graph2m(g)

Arguments

g

graph, object of class graphNEL (package ‘graph’)

Value

a square matrix whose dimensions are the number of nodes in the graph g, where element [i,j] equals 1 if there is a directed edge from node i to node j in the graph g, and 0 otherwise

Examples

Asiagraph<-m2graph(Asiamat)
Asia.adj<-graph2m(Asiagraph)

BiDAG documentation built on May 31, 2023, 6:46 p.m.

Related to graph2m in BiDAG...