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.
This will propagate the partition value of the target node to the edge, as
an edge property map. You then can pass this to "edge_color" in graph_draw().