Order rows/columns of a adjacency matrix topologically

topologically_ordering(adja_mat, alt = FALSE)

Arguments

adja_mat

Adjacency matrix of network

alt

Use igraph implementation

Value

topologically ordered matrix

Examples

adj <- matrix(c(0,1,0,0,0,1,0,0,0),3,3)
topologically_ordering(adj)
#>      [,1] [,2] [,3]
#> [1,]    0    1    0
#> [2,]    0    0    1
#> [3,]    0    0    0