Coordinates in a graph

Hi,I have a collections of objects which will be used as nodes.I know that depending which exe i run (dot,neato, etc) the graph gets a certain layout.Is it possible that i can get the coordinates of each node (after the graph is laid out) and use these coordinates everytime i need to create a graph which contains the certain node?For example let's say i have a simple graph with nodes called 'A', 'B', 'C' and 'D' and their respective edges. After I use a layout algorithm let's say that 'A' is put on upper-left side, is it possible that in every graph i want to produce ,and contains the 'A', the 'A' node will always be drawn in upper-left?

Sorry, there is no support

Sorry, there is no support for these types of general contraints in Graphviz. There are probably tricks you can play on a per-layout basis that can encourage such contraints, but they won't transfer between algorithms. Only fdp and neato allow explicit position information on input, and these will probably violate your constraints as they are not part of the function being optimized.

Oh thx for your information,I

Oh thx for your information,I have only one question you say that fdp and neato allow explicit position information on input but those position will be violated as they are not part of the fuction that will be optimized.What do you mean by that? which fuction is being optimized?Thank you again for your time.

For layouts using virtual

For layouts using virtual physical models, the nodes of a graph are treated like physical objects, with various forces (spring, electrical, magnetic, etc.) acting on them. The layout is achieved by finding positions of the nodes that (locally) minimizes the energy of the system or the forces on the nodes. WIth fdp and neato, you can fix a node at, say, the origin, and put all the other nodes in the first quadrant, but during the solution, it is quite possible that some other nodes will go into the other quadrants. In some cases, one can add additional forces to the system to represent desired constraints. For example, if you want all the other nodes to be above and to the right of the node at the origin, you might add repulsive forces generated by the positive and and y axes that only effect certain nodes. These types of extensions can sometimes work for a few constraints, but typically you start to get so many locally minima that any given constraint is not guaranteed to be satisfied at the end.

There has been work on graph layouts that explicitly encode constraints. For example, you might look at some of the work by Kim Marriott and his students.

Recent comments