Ask Your Question
0

Ornementation in Graph

asked 2021-03-15 17:13:16 +0100

Cyrille gravatar image
 A simple question due to my incompetence. In the following graph
g2={0:[1,2],1:[3],2:[],3:[0]}
strongly_connected_components(g2)
H2=DiGraph(g2)
show(H2.vertices())
H2.relabel({0:'A' , 1:'B', 2:'C', 3:'D'})
show(H2.vertices())
#H2.show(vertex_color='green',vertex_colors={'red': [0,1,3]},edge_colors={(.5,.25,.5):[('1',3,None),(1,3,None),(3,0,None)],(.25,.75,.25):[(0,2,None)]})
H2.show(vertex_color='green',vertex_colors={'red': ['A','B','D']},edge_colors={(.5,.25,.5):[('A','B',None),('B','D',None),('D','A',None)],(.25,.75,.25):[('A','C',None)]})

what means None (I have'nt found in the documentation. And is it possible to print the vertex like a LaTeX expression.

edit retag flag offensive close merge delete

Comments

None est l'étiquette par défaut des arêtes dans les graphes. C'est équivalent à l'absence d'étiquette.

FrédéricC gravatar imageFrédéricC ( 2021-03-15 17:45:03 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2021-03-15 22:47:37 +0100

Max Alekseyev gravatar image

These are edge labels. Each edge is described by a 3-element tuple $(s,t,l)$ where $s$ and $t$ are start/end vertices, and $l$ in a label. None means that there is no label.

edit flag offensive delete link more

Comments

Same answer that the one of FrédéricC. But for LaTex rendering ?

Cyrille gravatar imageCyrille ( 2021-03-16 11:19:01 +0100 )edit

According to https://doc.sagemath.org/html/en/refe...

Vertex Labels: can use latex formatting, and may have their colors specified, including on a per-vertex basis

Max Alekseyev gravatar imageMax Alekseyev ( 2021-03-16 23:52:01 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-03-15 17:13:16 +0100

Seen: 531 times

Last updated: Mar 15 '21