Jump to: navigation, search

Difference between revisions of "Importing a Pajek Graph"

Line 1: Line 1:
== File Format ==
+
== File Format ==
  
 
STEM allows users to create a custom graph using a format similar to the '''Pajek''' ([http://vlado.fmf.uni-lj.si/pub/networks/pajek/]) format. The PajekNetGraphGenerator, which is available in the graph creation dialogue of STEM, can create user-defined graphs for STEM and is based on this format.
 
STEM allows users to create a custom graph using a format similar to the '''Pajek''' ([http://vlado.fmf.uni-lj.si/pub/networks/pajek/]) format. The PajekNetGraphGenerator, which is available in the graph creation dialogue of STEM, can create user-defined graphs for STEM and is based on this format.
Line 5: Line 5:
  
 
  *Vertices [number of nodes]
 
  *Vertices [number of nodes]
  [node number] [node name] [longitude] [latitude] [additional optional parameters]
+
  [node number] [node name] [longitude] [latitude] [additional optional parameters] // spec for a new node
 +
[node number] [node name] // spec for reference to existing node
 
  ...
 
  ...
 
  *Edges
 
  *Edges
Line 12: Line 13:
 
  ...
 
  ...
  
=== *Vertices ===
+
== Node Format ==
  
The keyword "*Vertices [number of nodes]" is the starting point for the section, in which each node is described using following format:  
+
The keyword "*Vertices [number of nodes]" is the starting point for the section, in which each node is described using following format:
  
'''[node number] [node name] [longitude] [latitude] [optional parameters]'''
+
=== New Node ===
  
 +
'''[node number] [node name] [longitude] [latitude] [optional parameters]:'''
 
*node number – unique node number (1, 2, 3, ...). Successive numbering of nodes is obligatory.  
 
*node number – unique node number (1, 2, 3, ...). Successive numbering of nodes is obligatory.  
*node name – unique name consisting of letters a..zA..Z and digits 0..9. The definition of a label is obligatory.  
+
*node name – unique name consisting of letters a..zA..Z and digits 0..9.
*longitude, latitude – coordinates of the node. All values can be entered, but real world coordinates are: -180 <= longitude <= 180, 0 <= latitude <= 90. Coordinates are obligatory for STEM.
+
*longitude, latitude – coordinates of the node. All values can be entered, but real world coordinates are: -180 <= longitude <= 180, 0 <= latitude <= 90.
  
 
'''Optional parameters:'''
 
'''Optional parameters:'''
 
+
*popID – identifier of a population of the node. This parameter may be used repeatedly.
*popid – identifier of a population of the node. This parameter may be used repeatedly.
+
*popCount – number of individuals living in the node. This parameter may be used repeatedly. The associated popid is the last mentioned one.
*popcount – number of individuals living in the node. This parameter may be used repeatedly. The associated popid is the last mentioned one.
+
  
 
  Example: 1 Berlin 13.398889 52.500556 popID men popCount 1682900000 popID women popcount 1753500000
 
  Example: 1 Berlin 13.398889 52.500556 popID men popCount 1682900000 popID women popcount 1753500000
  
=== *Edges  ===
+
=== Node Reference ===
  
The keyword "*Edges" is the starting point for the edges section. Two types of edges can be described migration edges and containment edges. The format is as follows
+
'''[node number] [node name]:'''
  
'''Migration Edges: [origin node number] [destination node number] popID [populationID] rate [rate]'''
+
== Edges Format  ==
  
*v1 – initial vertex number. The definition of v1 is obligatory. v1 has to be defined as node (see above: vertexnum).
+
The keyword "*Edges" is the starting point for the edges section. Two types of edges can be described migration edges and containment edges. The format is as follows
*v2 – terminal vertex number. The definition of v2 is obligatory. v2 has to be defined as node (see above: vertexnum).
+
*borderlength – defines the borderlength for CommonBorderEdges
+
  
'''Containment Edges: [containing node number] [contained node number]'''
+
=== Migration Edges ===
  
'''Optional parameters for Migration Edges:'''
+
'''[origin node number] [destination node number] popID [populationID] rate [rate]:'''
 +
*origin node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.
 +
*destination node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.
 +
*populationID – defines the ID of the migrating population.
 +
*rate - number population members migrating per day.
  
''Parameters only valid in STEM (these parameters are ignored by Pajek):''  
+
'''Optional parameters:'''
 
+
*popid – identifier of a population migrating on the edge. This parameter may be used repeatedly. If this parameter and additionally “rateab” or “rateba” is set at least once then a MigrationEdge will be specified in STEM, otherwise a CommonBorderEdge will be defined.
+
 
+
*rateab – fraction of the population in node v1 migrating over the edge to the terminal node v2 in a given time period (see http://wiki.eclipse.org/Transportation_Models#Migration_Between_Regions). This parameter may be used repeatedly. The associated popid is the last mentioned one. The default value is 0.
+
  
*rateba – fraction of the population in node v2 migrating over the edge to the node v1 in a given time period. This parameter may be used repeatedly. The associated popid is the last mentioned one. The default value is 0.
+
=== Containment Edges ===
  
''Example: 1 2 popid human rateab 0.2 rateba 0.1 popid anopheles rateab 0.5 rateba 0.1''
+
'''[containing node number] [contained node number]:'''
 +
*containing node number – number of the node that contains the other node. Has to be defined as node number in *Vertices.  
 +
*contained node number – number of the node that is contained by the other node. Has to be defined as node number in *Vertices.
  
 
== Example  ==
 
== Example  ==

Revision as of 10:58, 27 June 2012

File Format

STEM allows users to create a custom graph using a format similar to the Pajek ([1]) format. The PajekNetGraphGenerator, which is available in the graph creation dialogue of STEM, can create user-defined graphs for STEM and is based on this format. The format specification is as follows.

*Vertices [number of nodes]
[node number] [node name] [longitude] [latitude] [additional optional parameters] // spec for a new node
[node number] [node name] // spec for reference to existing node
...
*Edges
[origin node number] [destination node number] popID [populationID] rate [rate] // spec for migration edges
[containing node number] [contained node number] // spec for containment edges
...

Node Format

The keyword "*Vertices [number of nodes]" is the starting point for the section, in which each node is described using following format:

New Node

[node number] [node name] [longitude] [latitude] [optional parameters]:

  • node number – unique node number (1, 2, 3, ...). Successive numbering of nodes is obligatory.
  • node name – unique name consisting of letters a..zA..Z and digits 0..9.
  • longitude, latitude – coordinates of the node. All values can be entered, but real world coordinates are: -180 <= longitude <= 180, 0 <= latitude <= 90.

Optional parameters:

  • popID – identifier of a population of the node. This parameter may be used repeatedly.
  • popCount – number of individuals living in the node. This parameter may be used repeatedly. The associated popid is the last mentioned one.
Example: 1 Berlin 13.398889 52.500556 popID men popCount 1682900000 popID women popcount 1753500000

Node Reference

[node number] [node name]:

Edges Format

The keyword "*Edges" is the starting point for the edges section. Two types of edges can be described migration edges and containment edges. The format is as follows

Migration Edges

[origin node number] [destination node number] popID [populationID] rate [rate]:

  • origin node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.
  • destination node number – number of the node the population migrates from. Has to be defined as node number in *Vertices.
  • populationID – defines the ID of the migrating population.
  • rate - number population members migrating per day.

Optional parameters:

Containment Edges

[containing node number] [contained node number]:

  • containing node number – number of the node that contains the other node. Has to be defined as node number in *Vertices.
  • contained node number – number of the node that is contained by the other node. Has to be defined as node number in *Vertices.

Example

*Vertices 3
1 Berlin 1 1 popID men popCount 100 popID women popCount 110
2 Bonn 1.5 1 popID men popCount 100 popID women popCount 110
3 Germany 1.2 1.2
*Edges
1 2 popID men rate 0.1
2 1 popID women rate 0.2
3 1
3 2

Running the downloadable pajek scenario the map view should appear as shown below.

STEM PajekExample.png

Using the dialog

STEM PajekDialog.png

Contributors

The PajekNetGraphGenerator was created and developed by the Department of Biological Safety of the Federal Institute for Risk Assessment in Germany.

Armin A. Weiser, Matthias Filter, Christian Thöns
Dept. Biological Safety 
Federal Institute for Risk Assessment
12277 Berlin
Germany