24 Sep
2018
24 Sep
'18
9:57 p.m.
Hi all, Today I need to know how, in a directed graph, I can color a directed edge by the color of the target node. In this example f = Graph(directed=True) f.add_edge_list([[0, 1], [0, 2], [1, 2]]) partition = f.new_vertex_property('int') blocks = [0, 0, 1] for i in range(0, 3): partition[f.vertex(i)] = blocks[i] graph_draw(f, vertex_fill_color=partition) vertices 0 and 1 have the color of partition 0 and vertex 2 has the color of partition 1. Accordingly, edge (0, 1) should have the same color as block 0, edge (0, 2) should have the same color as block 1 and edge (1, 2) should have the same color as block 1. Thanks again Haiko