Graphs are stored in GraphSynth as designGraph.cs. The “design” keyword is to distinguish it from other types that may be used within larger implementations. For example, in GraphSynth an open source library known as Netron is used for visualization. This compiled project (as a .dll) contains it’s own definition for graph. On opening designGraph.cs (under the 1.Representation folder), we see the following:

public partial class designGraph
   publicstring name;
   public
List<string> globalLabels;
   public List < double > globalVariables;
   publicList<node> nodes = newList<node>();

   publicList<arc> arcs = newList<arc>();

The graph contains a name, labels (which are any number of strings), and variables (a list of any number of double-real''s). Additionally, there are two lists: one for arcs and one for nodes. This is a “partial” description of the designGraph class, the rest is stored in the XMLandIO directory. The classes for arc and node are also fairly straightforward. Note that each of these contains references to the connecting elements (to and from in arc point to the two nodes connected to the arc; and arcsTo, arcsFrom, and arcs in node reference connecting arcs).

One can freely draw graphs in GraphSynth by clicking FileNew→Graph or typing Ctrl+N. A small empty box appears for you to add nodes, arcs and their labels. There are five node shapes. These can be added by right-clicking and scrolling to “Basic Shapes” or by typing Ctrl+1, Ctrl+2, Ctrl+3, Ctrl+4, Ctrl+5, Ctrl+6, or Ctrl+7. Each of these shapes has one or more connection points. By hovering the mouse over a connection point, one and click-and-drag arcs between shapes. By double-clicking an arc or node, or clicking Properties from the right-click menu, one can access various properties of the element.

 

an example graph created by GraphSynth
Figure 1: Creating a new graph in GraphSynth is accomplished by adding new nodes (with right-click or Ctrl+#), dragging arcs into places, and adjusting properties via the Properties Window.

 

 

 

 

 

 

 

 

 

 
 

Graphs like all other GraphSynth elements are stored as XML files. These files can be opened in a text editor and altered as well. The example graph in figure one is saved as the following:

example XML data from graph example XML data from graph

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 

Graphs like all other GraphSynth elements are stored as XML files. These files can be opened in a text editor and altered as well. The example graph in figure one is saved as the following:

Inherited Types

Inherited types can be created for nodes and arcs so that applications requiring more descriptive objects for nodes and arcs can be used. Note that in the XML, the second node is qualified by the vertex type. As an example of inherited classes, a basic implementation of vertex and edge are presented in the file, inheritedGeometryClasses.cs. Once these are created and properly compiled in GraphSynth, the classes can be placed in the Properties Window under the nodeType or arcType tags. Additionally, the types can be used in the creation of rules. If a rule is made for vertices and edges it will only be recognized on graphs that contain such classes.

Last edited Feb 8, 2014 at 6:00 PM by mattica, version 1