Reputation: 848
is there any algorithm or is there any name for a transformation of a graph where one can transform edges into vertices and vertices into edges? Just so we could get a new graph out of it or anything similiar to this problem? I'm not sure if it actually makes sense but I'd be glad if you could give me just any hint about a problem like this.
Upvotes: 22
Views: 13656
Reputation: 991
What you are asking for is a line graph. You can use the networkx line_graph function to create a line graph or dual graph of a given graph. However, note that this function does not propagate the data from the original graph so you will have to hack your way around that if you need it.
Upvotes: 3
Reputation: 1213
Have you thought about pattern-based graph transformation? Like that you would
In graph transformation literature, these two steps are called left-hand side and right-hand side of a graph-transformation-rule.
There is a lot of scientific literature available in that field, e.g.: http://www.springer.com/de/book/9783319211442
There are also specialized development solutions for graph transformation, like Soley Studio.
Hope that helps.
Upvotes: 3
Reputation: 1300
LineGraph is a built-in function in Wolfram Language:
http://reference.wolfram.com/language/ref/LineGraph.html
This is what it does:
Upvotes: 4
Reputation: 837
I believe you could easily turn the edges into vertices using the following Python library: http://networkx.lanl.gov/
You can get the edge list, the nodes list and exchange the two for building a new graph. You just need some (basic) knowledge of Python.
Upvotes: -1