Jump to: navigation, search

Difference between revisions of "Creating a new Graph"

(Creating a Graph of Seasonal Migration Edges)
(Custom Graphs)
 
(10 intermediate revisions by the same user not shown)
Line 6: Line 6:
 
= Custom Graphs =
 
= Custom Graphs =
  
The world wide administrative data built into STEM is represented as a [[STEM Design Document#Graph | 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.
+
The worldwide administrative data built into STEM is represented as a [[STEM Design Document#Graph | 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) is 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.
  
 
[[Image:Newgraph1.gif|400px]]  
 
[[Image:Newgraph1.gif|400px]]  
'''Button to launch the New Graph Wizard'''
+
''Figure 1. Button to launch the New Graph Wizard''
 +
 
  
  
Line 37: Line 38:
 
<br style="clear: both" />
 
<br style="clear: both" />
  
<DIV ALIGN=RIGHT>''Figure 8. A disease spreading on a square lattice''</DIV>''Figure 7. The New Graph Wizard''
+
<DIV ALIGN=RIGHT>''Figure 2. A disease spreading on a square lattice''</DIV>''Figure 3. The New Graph Wizard''
  
 
==Creating a Graph from a Pajek File ==
 
==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]]'''.
+
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 a graph, '''''please see the page on'''''  '''[[Importing a Pajek Graph]]'''.
  
 
== Creating a Graph of Migration Edges ==  
 
== Creating a Graph of Migration Edges ==  
  
[[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.
+
[[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.
  
 
[[Image:Newgraph2.gif|300px]]
 
[[Image:Newgraph2.gif|300px]]
  
'''Migration Edge Graph Generator'''
+
''Figure 4. Migration Edge Graph Generator''
 +
 
  
 
== Creating a Graph of Seasonal Migration Edges ==
 
== Creating a Graph of Seasonal Migration Edges ==
  
''(new)''
 
  
The '''Seasonal Migration Edge Graph Generator''' works together with a [[STEM_Population_Models#Seasonal_Migratory_Population_Model|Seasonal Migratory Population Model]] to allow uses to create models where animals migrate seasonally between regions. The edges are just ordinary migration edges. Migratory Population Model simply modulates the migration rate with a sinusoidal function.  As such, negative migration rates are simply ignored by the population model and the population moves only along edges with positive rates. At the end of the season, when the sign of the migration rates changes on some nodes, so does the direction of migration. The Seasonal Migration Edge Graph Generator is a simple way to create a suitable collection of migration edges between two regions. Users are free to create their own sub-graph by other means including pajek. In the example below we show how a migratory sub-graph was constructed for an existing square lattice.
+
The '''Seasonal Migration Edge Graph Generator''' works together with a [[STEM_Population_Models#Seasonal_Migratory_Population_Model|Seasonal Migratory Population Model]] to allow users to create models where animals migrate seasonally between regions. The edges are just ordinary migration edges. The Migratory Population Model simply modulates the migration rate with a sinusoidal function.  As such, negative migration rates are simply ignored by the population model and the population moves only along edges with positive rates. At the end of the season, when the sign of the migration rates changes on some nodes, so does the direction of migration. The Seasonal Migration Edge Graph Generator is a simple way to create a suitable collection of migration edges between two regions. Users are free to create their own sub-graph by other means including pajek. In the example below we show how a migratory sub-graph was constructed for an existing square lattice.
  
 
[[Image:MigBirdGraph.png|400px]][[Image:STEM_Migration1.png|400px]]
 
[[Image:MigBirdGraph.png|400px]][[Image:STEM_Migration1.png|400px]]
  
'''Creating a sub-graph of seasonal migration edges'''
+
''Figure 5. Creating a sub-graph of seasonal migration edges''
  
The user specifies two target nodes (A and B) in the parent graph. The user also specifies the angle &alpha; for two rays from node A (+/- 45 degrees in the example) and two rays at angle &beta; about node B (+/- 30 degrees in the example). The Seasonal Migration Edge Graph Generator creates migration edges based on the existing nearest neighbor edges contained in the quadrilateral with vertices as A & B and at the intersection of the rays constructed from each. The nodes are selected by the 'PICK' buttons. This launches a separate dialog where uses can chose a node first by selecting 'choose from within project' as shown below.
+
The user specifies two target nodes (A and B) in the parent graph. The user also specifies the angle &alpha; for two rays from node A (+/- 45 degrees in the example) and two rays at angle &beta; about node B (+/- 30 degrees in the example). The Seasonal Migration Edge Graph Generator creates migration edges based on the existing nearest neighbor edges contained in the quadrilateral with vertices as A & B and at the intersection of the rays constructed from each. The nodes are selected by the 'PICK' buttons. This launches a separate dialog where users can chose a node first by selecting 'choose from within project' as shown below.
  
 
[[Image:PickNode.png|300px]]
 
[[Image:PickNode.png|300px]]
  
'''Picking a node from the set defined in a graph within your existing project'''
+
''Figure 6. Picking a node from a set defined in a graph within your existing project''
  
 
== Creating a Graph of Custom Mixing Edges ==  
 
== Creating a Graph of Custom Mixing 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.
+
[[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 an 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:Newgraph3.png|300px]]
 
[[Image:Newgraph3.png|300px]]
  
'''Mixing Edge Graph Generator'''
+
''Figure 7. Mixing Edge Graph Generator''
  
 
== Creating a Graph from an Esri Shapefile ==
 
== 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]]'''.
 
For information on how to create a graph from an Esri shapefile, please see the page on  '''[[Importing an Esri Shapefile]]'''.

Latest revision as of 10:41, 2 August 2013

STEM TOP BAR.gif

Custom Graphs

The worldwide 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) is 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 Figure 1. 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 2. A disease spreading on a square lattice
Figure 3. 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 a 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

Figure 4. Migration Edge Graph Generator


Creating a Graph of Seasonal Migration Edges

The Seasonal Migration Edge Graph Generator works together with a Seasonal Migratory Population Model to allow users to create models where animals migrate seasonally between regions. The edges are just ordinary migration edges. The Migratory Population Model simply modulates the migration rate with a sinusoidal function. As such, negative migration rates are simply ignored by the population model and the population moves only along edges with positive rates. At the end of the season, when the sign of the migration rates changes on some nodes, so does the direction of migration. The Seasonal Migration Edge Graph Generator is a simple way to create a suitable collection of migration edges between two regions. Users are free to create their own sub-graph by other means including pajek. In the example below we show how a migratory sub-graph was constructed for an existing square lattice.

MigBirdGraph.pngSTEM Migration1.png

Figure 5. Creating a sub-graph of seasonal migration edges

The user specifies two target nodes (A and B) in the parent graph. The user also specifies the angle α for two rays from node A (+/- 45 degrees in the example) and two rays at angle β about node B (+/- 30 degrees in the example). The Seasonal Migration Edge Graph Generator creates migration edges based on the existing nearest neighbor edges contained in the quadrilateral with vertices as A & B and at the intersection of the rays constructed from each. The nodes are selected by the 'PICK' buttons. This launches a separate dialog where users can chose a node first by selecting 'choose from within project' as shown below.

PickNode.png

Figure 6. Picking a node from a set defined in a graph within your existing project

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 an 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

Figure 7. 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.