Difference between revisions of "Importing a Pajek Graph"

From Eclipsepedia

Jump to: navigation, search
(PajekNetGraphGenerator and STEM-related Format extension to Pajek)
Line 3: Line 3:
 
'''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 following reserved words are supported:
 
'''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 following reserved words are supported:
  
1. *Vertices n – n is number of vertices. In STEM nodes are the equivalent of vertices. Each vertex is described using following format (take care of the sequence of the parameters, additional and STEM-only parameters may be in any order):
+
===1. *Vertices n – n is number of vertices. In STEM nodes are the equivalent of vertices. Each vertex is described using following format (take care of the sequence of the parameters, additional and STEM-only parameters may be in any order):===
  
 
* vertexnum label x y [z] [shape] [additional optional parameters]
 
* vertexnum label x y [z] [shape] [additional optional parameters]
Line 17: Line 17:
 
* s_size – size of the node. The default size is given by the parameter “Default Area” within the PajekNetGraphGeneratorImpl dialog in STEM. For STEM the size of the node is not limited. Overlaps of nodes are not checked by the importer, they are allowed.
 
* s_size – size of the node. The default size is given by the parameter “Default Area” within the PajekNetGraphGeneratorImpl dialog in STEM. For STEM the size of the node is not limited. Overlaps of nodes are not checked by the importer, they are allowed.
  
Example: 1 ”vertex one” 0.3456 0.1234 0.5 ellipse s_size 0.1
+
''Example: 1 ”vertex one” 0.3456 0.1234 0.5 ellipse s_size 0.1''
  
Parameters only valid in STEM (these parameters are ignored by Pajek):
+
===Parameters only valid in STEM (these parameters are ignored by Pajek):===
  
 
* 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.
Line 25: Line 25:
 
* 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 ”vertex one” 0.3456 0.1234 0.5 ellipse s_size 0.1 popid human popcount 24 popid anopheles popcount 1000
+
''Example: 1 ”vertex one” 0.3456 0.1234 0.5 ellipse s_size 0.1 popid human popcount 24 popid anopheles popcount 1000
 +
''
  
 
+
==='''2. *Edges''' – definition of edges. Format (take care of the sequence of the parameters, STEM-only parameters may be in any order):===
2. *Edges – definition of edges. Format (take care of the sequence of the parameters, STEM-only parameters may be in any order):
+
  
 
v1 v2 [borderlength] [additional optional parameters]
 
v1 v2 [borderlength] [additional optional parameters]
Line 37: Line 37:
  
  
Parameters only valid in STEM (these parameters are ignored by Pajek):
+
===Parameters only valid in STEM (these parameters are ignored by Pajek):===
  
 
* 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.
 
* 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.
Line 45: Line 45:
 
* 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.
 
* 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.
  
Example: 1 2 popid human rateab 0.2 rateba 0.1 popid anopheles rateab 0.5 rateba 0.1
+
''Example: 1 2 popid human rateab 0.2 rateba 0.1 popid anopheles rateab 0.5 rateba 0.1''
  
3. *Arcs – definition of arcs. The same parameters as for edges can be used, see above.
+
===3. *Arcs – definition of arcs. The same parameters as for edges can be used, see above.===
  
  

Revision as of 19:15, 6 December 2010

Contents

PajekNetGraphGenerator and STEM-related Format extension to Pajek

Pajek ([1]) 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 following reserved words are supported:

1. *Vertices n – n is number of vertices. In STEM nodes are the equivalent of vertices. Each vertex is described using following format (take care of the sequence of the parameters, additional and STEM-only parameters may be in any order):

  • vertexnum label x y [z] [shape] [additional optional parameters]
  • vertexnum – vertex number (1; 2; 3 : : : n). Successive numbering of vertices/nodes is obligatory. vertexnum itself is not used inside STEM after import.
  • label – if label starts with character a..zA..Z or 0..9 first blank determines end of the label (e.g., vertex1), labels consisting of more words must be enclosed in pair of special characters (e.g., ”vertex 1”). The definition of a label is obligatory.
  • x, y, z – coordinates of vertex. The z coordinate is ignored in STEM. In Pajek the coordinates have values between 0 and 1, for STEM the values are not limited. x and y coordinates are obligatory for STEM.
  • shape – shape of object which represents vertex. The following shapes are supported by the PajekNetGraphGenerator: triangle, cross, ellipse, box, diamond. In STEM ellipse is represented as circle and box and diamond both are represented as box. box is the default value.
  • Additional parameters:
  • s_size – size of the node. The default size is given by the parameter “Default Area” within the PajekNetGraphGeneratorImpl dialog in STEM. For STEM the size of the node is not limited. Overlaps of nodes are not checked by the importer, they are allowed.
Example: 1 ”vertex one” 0.3456 0.1234 0.5 ellipse s_size 0.1

Parameters only valid in STEM (these parameters are ignored by Pajek):

  • 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 ”vertex one” 0.3456 0.1234 0.5 ellipse s_size 0.1 popid human popcount 24 popid anopheles popcount 1000

2. *Edges – definition of edges. Format (take care of the sequence of the parameters, STEM-only parameters may be in any order):

v1 v2 [borderlength] [additional optional parameters]

  • v1 – initial vertex number. The definition of v1 is obligatory. v1 has to be defined as node (see above: vertexnum).
  • 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


Parameters only valid in STEM (these parameters are ignored by Pajek):

  • 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.
  • 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.
Example: 1 2 popid human rateab 0.2 rateba 0.1 popid anopheles rateab 0.5 rateba 0.1

3. *Arcs – definition of arcs. The same parameters as for edges can be used, see above.

Appended you will find some examples that may be imported into STEM. The filename extension “.net” is not mandatory for STEM:

  • CC.NET_2stem.net
  • 1.NET_2stem.net