M2 icon indicating copy to clipboard operation
M2 copied to clipboard

Graphs package: No error when handling negative adjacency matrices

Open MikeAdamer opened this issue 6 years ago • 4 comments

When accidentally handing an adjacency matrix with negative entries it the "Graphs" package gives output which looks correct, but the edge set is empty.

E.g.:

A = matrix{{0,-1},{-1,0}}
G = digraph A

Should it throw an error when any entry in the adjacency matrix is negative?

MikeAdamer avatar Jun 07 '18 13:06 MikeAdamer

@b-stone @windisch @dcookii

DanGrayson avatar Jun 23 '18 20:06 DanGrayson

I even would say that an exception should be thrown if any entry of the provided adjacent matrix is not in {0, 1}.

windisch avatar Jun 27 '18 18:06 windisch

Who would like to make the change?

DanGrayson avatar Jun 27 '18 18:06 DanGrayson

I am traveling right now, but I can work on this next week if someone does not beat me to this.

bstone avatar Jun 27 '18 19:06 bstone