Jump to: navigation, search

Difference between revisions of "Creating a new Graph"

(Creating a Graph from a (Pajek) File)
(Creating a Graph from a Pajek File)
(13 intermediate revisions by 4 users not shown)
Line 39: Line 39:
 
<DIV ALIGN=RIGHT>''Figure 8. A disease spreading on a square lattice''</DIV>''Figure 7. The New Graph Wizard''
 
<DIV ALIGN=RIGHT>''Figure 8. A disease spreading on a square lattice''</DIV>''Figure 7. The New Graph Wizard''
  
==Creating a Graph from a (Pajek) File ==
+
==Creating a Graph from a Pajek File ==
  
[[Image:PajekExample.jpg|right|400px]] The New Graph wizard also makes if possible to import files in the Pajek format. Simply select and then specify the folder that contains the external Pajek files.  
+
The New Graph wizard also makes it possible to import files in a format similar to Pajek. For information on this format and how to import graph, '''''please see the page on'''''  '''[[Importing a Pajek Graph]]'''.
  
For more information on how to create a graph from a pajek file, please see the page on '''[[Importing a Pajek Graph]]'''.
+
== Creating a Graph of Migration Edges ==
This page also contains information about the downloadable example scenario based upon Pajek.
+
  
 +
[[Transportation Models | See also Migration Edges]]: When working with an existing graph, you can create another graph of components you may want to add to the original graph. For example, you can use the Migration Edge Graph Generator to create a graph of migration edges. If you add these to a model containing the original graph, migration of a population will be enabled. Migration edges are created for a specified population and, at the current time, with a single migration rate. If you do not specify a  location, a migration edge is created for every physically adjacent region of every node within the  graph. If you specify a location, migration edges are created for every physically adjacent region the selected location (i.e., node) contains. For example, if you are working with a graph of the United States, specifying California will create migration edges for every county in California. In the future, we will provide a graphical editor to allow creation of specific edges.
  
STEM allows users to create a custom graph using Pajek. '''Pajek''' ([http://vlado.fmf.uni-lj.si/pub/networks/pajek/]) uses a kind of standardized language for describing networks. Some examples might be found here: http://vlado.fmf.uni-lj.si/pub/networks/pajek/testdata.zip. A subset of this language is interpreted by the PajekNetGraphGenerator to import arbitrary graphs into STEM. The PajekNetGraphGenerator allows creating user-defined graphs (coordinates and shapes of nodes, type and rates of edges) for STEM and is based on the Pajek format.
+
[[Image:Newgraph2.gif|300px]]
  
 +
'''Migration Edge Graph Generator'''
  
An example project available for download may be found on the STEM website or a [http://www.eclipse.org/stem/download_sample.php?file=MultiPopulationExample_PajekGraphs.zip]. This is a standard STEM project that you may import into your workspace. It contains a graph generated using the Pajek Graph Generator. It also contains examples of the original Pajek files used to create the graphs found in the project. The files are located in the 'Doc' directory of the project. Also in that directory you can find additional documentation. Read the PajekStem_Format.doc (or PajekStem_Format.txt) for further information about the modified Pajek format. The PajekNetGraphGenerator is
 
available in the graph creation dialogue of STEM. Please see the page [[Creating a new Graph]] for information on using this dialog.
 
  
== Creating a Graph of Migration Edges ==  
+
== Creating a Graph of Custom Mixing Edges ==  
  
[[Transportation Models | See also Migration Edges]]: Given an existing graph, another graph generator allows a user to create a graph of components that may be (optionally) added to the existing graph. For example, the Migration Edge Graph Generator will create a graph of migration edges. If these are then added to a model containing the original graph, migration of a population will be enabled. Migration edges are created for a specified population and, at the current time, with a single migration rate. If no location is specified, a migration edge is created for every physically adjacent region of node within a graph. If a location is specified, migration edges are created for every physically adjacent region the selected node contains. For example, give a graph of the United States, specifying California would create migration edges for every county in California. In the future we will provide a graphical editor to allow creation of specific edges.
+
[[Transportation_Models#Mixing_Edges:_Custom_Mixing_Models | See also Mixing Edges]]: When working with an existing graph, you can create another graph of components you may want to add to the original graph. For example, you can use the Mixing Edge Graph Generator to create a user customizable graph of mixing edges with a fixed (default) mixing rate or even individually specified mixing rates. Mixing rates can be specified as a fraction of the population or as a absolute number. If you add mixing edges to a model containing the original graph, mixing of a population will be enabled based on these rates (and the default model for mixing human populations will NOT be run). Mixing edges are created for a specified population and with a user specified mixing rate. Users can then edit the generate .graph file to tailor each and every rate based on their own algorithms or data. If you do not specify a  location, a mixing edge is created for every physically adjacent region of every node within the  graph. If you specify a location, mixing edges are created for every physically adjacent region the selected location (i.e., node) contains. For example, if you are working with a graph of the United States, specifying California will create mixing edges for every county in California. In the future, the graphical editor will also allow creation of specific edges.
  
[[Image:Newgraph2.gif|300px|left]]
+
[[Image:Newgraph3.png|300px]]
'''Migration Edge Graph Generator'''
+
 
 +
'''Mixing Edge Graph Generator'''
 +
 
 +
== Creating a Graph from an Esri Shapefile ==
 +
 
 +
For information on how to create a graph from an Esri shapefile, please see the page on  '''[[Importing an Esri Shapefile]]'''.

Revision as of 08:24, 26 June 2012

STEM TOP BAR.gif

Custom Graphs

The world wide administrative data built into STEM is represented as a graph. It is also possible for users to create their own custom graphs using the new graph wizard. The New Graph wizard supports user creation of custom lattices based on a set of "Graph Generators." A graph generator is a pluggable component able to generate a graph (a collection of nodes and edges) either algorithmically or from an external file. Currently, we have implemented an abstract Lattice Graph Generator with a Square Lattice Implementation. A user can specify the size of the lattice as well as several options for how the nearest neighbor (Common Border) are organized. In the future we plan to also support creating a New Graph From File. A graph generator can also be used to create a collection of edges (or other graph components) that can be optionally added to another graph. To use this feature, begin by launching the new graph wizard.

Newgraph1.gif Button to launch the New Graph Wizard


Creating a Square Lattice Graph

This wizard makes it possible to study the propagation of a disease model on (for example) a simple lattice instead of the more complex geographical administrative divisions.

1) Click on New Graph

2) Name your project

3) Click on TestSquareLattice

4) Specify the size of the lattice

5) Select from the options available how you want the nearest neighbor mixing edges to be organized

6) Click "Finished"

save your work at this point by hitting <ctrl>S

In the future we plan to also support creating a New Graph From File.


NewGraph.jpg
SquareLattice.png


Figure 8. A disease spreading on a square lattice
Figure 7. The New Graph Wizard

Creating a Graph from a Pajek File

The New Graph wizard also makes it possible to import files in a format similar to Pajek. For information on this format and how to import graph, please see the page on Importing a Pajek Graph.

Creating a Graph of Migration Edges

See also Migration Edges: When working with an existing graph, you can create another graph of components you may want to add to the original graph. For example, you can use the Migration Edge Graph Generator to create a graph of migration edges. If you add these to a model containing the original graph, migration of a population will be enabled. Migration edges are created for a specified population and, at the current time, with a single migration rate. If you do not specify a location, a migration edge is created for every physically adjacent region of every node within the graph. If you specify a location, migration edges are created for every physically adjacent region the selected location (i.e., node) contains. For example, if you are working with a graph of the United States, specifying California will create migration edges for every county in California. In the future, we will provide a graphical editor to allow creation of specific edges.

Newgraph2.gif

Migration Edge Graph Generator


Creating a Graph of Custom Mixing Edges

See also Mixing Edges: When working with an existing graph, you can create another graph of components you may want to add to the original graph. For example, you can use the Mixing Edge Graph Generator to create a user customizable graph of mixing edges with a fixed (default) mixing rate or even individually specified mixing rates. Mixing rates can be specified as a fraction of the population or as a absolute number. If you add mixing edges to a model containing the original graph, mixing of a population will be enabled based on these rates (and the default model for mixing human populations will NOT be run). Mixing edges are created for a specified population and with a user specified mixing rate. Users can then edit the generate .graph file to tailor each and every rate based on their own algorithms or data. If you do not specify a location, a mixing edge is created for every physically adjacent region of every node within the graph. If you specify a location, mixing edges are created for every physically adjacent region the selected location (i.e., node) contains. For example, if you are working with a graph of the United States, specifying California will create mixing edges for every county in California. In the future, the graphical editor will also allow creation of specific edges.

Newgraph3.png

Mixing Edge Graph Generator

Creating a Graph from an Esri Shapefile

For information on how to create a graph from an Esri shapefile, please see the page on Importing an Esri Shapefile.