I have a weighted directed multigraph and I would like to make a line graph from it. That is replace each edge by a node and connect two nodes if there is a directed path with a common node between the two edges in the original multigraph. However, in my case I only say there is a path between two edges if the weight of the second is greater than the first.
There is an implementation of a basic line graph algorithm in networkx http://networkx.github.io/documentation/latest/reference/generated/networkx.generators.line.line_graph.html . However this does not support multigraphs.
Is there a nice way to do this in networkx or igraph?