Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 4 years ago

klaaa gravatar image

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1. Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2=RR (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position.

Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ui,j is 1.

My question is whether there is a quick method to obtain all 0-1 matrices with Sage for a given n and the associated graph GM.

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1. Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2=RR R2 (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position.

Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ui,j is 1.

My question is whether there is a quick method to obtain all 0-1 matrices with Sage for a given n and the associated graph GM.

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1. Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2 (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position.

Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ui,j is 1.

For example when M is the matrix with rows [1,1,1],[0,1,1],[0,0,1] then the graph GM has 3 vertices with an arrow from 1 to 2 and an arrow from 2 to 3.

My question is whether there is a quick method to obtain all 0-1 matrices with Sage for a given n and the associated graph GM.

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1 and all diagonal entries equal to 1. Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2 (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position.

Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ui,j is 1.

For example when M is the matrix with rows [1,1,1],[0,1,1],[0,0,1] then the graph GM has 3 vertices with an arrow from 1 to 2 and an arrow from 2 to 3.

My question is whether there is a quick method to obtain all such 0-1 matrices with Sage for a given n and the associated graph GM.GM displayed as a picture.

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1 and all diagonal entries equal to 1. Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2 (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position.

Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ui,j is 1.

For example when M is the matrix with rows [1,1,1],[0,1,1],[0,0,1] then the graph GM has 3 vertices with an arrow from 1 to 2 and an arrow from 2 to 3.

My question is whether there is a quick method to obtain all such 0-1 matrices with Sage for a given n and the associated graph GM displayed as a picture.picture (and as a graph in sage).

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1 and all diagonal entries equal to 1. Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2 (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position.

position. Let C=(ci,j) be the matrix RU. Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ui,j ci,j is 1.

For example when M is the matrix with rows [1,1,1],[0,1,1],[0,0,1] then the graph GM has 3 vertices with an arrow from 1 to 2 and an arrow from 2 to 3.

My question is whether there is a quick method to obtain all such 0-1 matrices with Sage for a given n and the associated graph GM displayed as a picture (and as a graph in sage).

Obtaining directed graphs associated to matrices

Let M be an n×n-matrix with entries only 0 or 1 and all diagonal entries equal to 1. 1. (usually M is upper triangular) Let R be the same matrix as M but with all diagonal entries set to zero. Let U=(ui,j) be the matrix with 1 as an entry if R2 (the matrix product of R with itself) has a non-zero entry in the same position and let U have 0 in this entry if R2 has 0 as an entry in this position. Let C=(ci,j) be the matrix RU. Let GM be the directed graph with n vertices and there is an arrow from i to j if and only if ci,j is 1.

For example when M is the matrix with rows [1,1,1],[0,1,1],[0,0,1] then the graph GM has 3 vertices with an arrow from 1 to 2 and an arrow from 2 to 3.

My question is whether there is a quick method to obtain all such 0-1 matrices with Sage for a given n and the associated graph GM displayed as a picture (and as a graph in sage).