# signed graphs

Can signed graphs be handled by sage ?

signed graphs

Can signed graphs be handled by sage ?

add a comment

0

What do you mean by handled? You can make a graph with edge weights in 1,-1:

```
sage: m = random_matrix(QQ, 5,5, num_bound=1, den_bound=1,density=0.75)
sage: m
[-1 0 0 1 1]
[ 1 0 0 1 0]
[ 0 0 0 1 -1]
[ 0 1 0 1 1]
[ 1 0 1 0 0]
sage: G = Graph(m,format='weighted_adjacency_matrix')
sage: G
Looped graph on 5 vertices
sage: G.edges()
[(0, 0, -1), (0, 3, 1), (0, 4, 1), (1, 3, 1), (2, 3, 1), (2, 4, -1), (3, 3, 1), (3, 4, 1)]
sage: G.weighted()
True
sage: G.incidence_matrix()
[-1 -1 0 0 0 0 0 1]
[ 0 0 -1 0 0 0 0 0]
[ 0 0 0 -1 -1 0 0 0]
[ 0 1 1 0 1 -1 1 0]
[ 1 0 0 1 0 1 0 0]
```

Though according to http://en.wikipedia.org/wiki/Signed_graph#Other_kinds_of_.22signed_graph.22, these are not quite the same thing because of the additional multiplicative structure...

0

Asked: **
2011-10-31 14:42:11 -0500
**

Seen: **226 times**

Last updated: **Oct 31 '11**

How to convert (some particular) Sage objects into Macaulay2 ones

edge labels and vertex size causes problems

How would you plot these data points?

Graph based on y value as the input, and x as the output?

How to use Sage to find a pair of vertex-disjoint paths of minimal total length?

Graphing Compex Functions 3D (x,y,i axes) Instead Of Color-Coded 2D (x,i)

Plotting a frequency chart from a set of values

Enumerate isomrphic subgraphs of graph vertex labeled

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.