Pajek format

A network N = (V,L,P,W) is determined with four sets:

  • the set of nodes V,
  • the set of links L,
  • the set of node properties P, and
  • the set of link properties (weights) W .

The set of nodes and the set of links describe its structure and form a graph G = (V,L).

A = ∅ - undirected graph
E = ∅ - directed graph

Basic formats

Mathematical description

V = { a, b, c, d, e, f, g, h, i, j, k, l }
A = { (a,b), (a,d), (a,f), (b,a), (b,f), (c,b), (c,c), (c,g)1, (c,g)2, (e,c), (e,f), (e,h), (f,k), (h,d), (h,l), (j,h), (l,e), (l,g), (l,h) }
E = { (b:e), (c:d), (e:g), (f:h) }
G = ( V, (A, E) )
L = AE

Sets

The nodes are indexed starting with 1. In listing of links (arcs or edges) their end-nodes are replaced by their indices.

A line describing a node (vertex) has the following components: index, label, X, Y, Z. If the label contains a space it should be put in quotes “la bel”. Pajek's internal coordinates X, Y, Z are in the range [0,1]. If your coordinates are out of this range (for example geographical longitude and latitude) you can transform them into the Pajek's range in the drawing window using the option

Options/Transform/Fit Area

You can even skip the list of nodes - specifying only the line *vertex n. In this case the node labels will be created automatically and the coordinates are put on the circle.

A line describing a link has the following components: 1st-node-index, 2nd-node-index, weight. If the weight is omitted the default value 1 is used.

A line starting with % is a comment line.

% Example network
% by Vladimir Batagelj, April 2003
*Vertices  12
  1 "a"     0.1020  0.3226
  2 "b"     0.2860  0.0876
  3 "c"     0.5322  0.2304
  4 "d"     0.3259  0.3917
  5 "e"     0.5543  0.4770
  6 "f"     0.1552  0.6406
  7 "g"     0.8293  0.3249
  8 "h"     0.4479  0.6866
  9 "i"     0.8204  0.8203
 10 "j"     0.4789  0.9055
 11 "k"     0.1175  0.9032
 12 "l"     0.7095  0.6475
*Arcs
  1  2
  2  1
  1  4
  1  6
  2  6
  3  2
  3  3
  3  7
  3  7
  5  3
  5  6
  5  8
  6 11
  8  4
 10  8
 12  5
 12  7
  8 12
 12  8
*Edges
  2  5
  3  4
  5  7
  6  8

GraphSet: PDF / net; TinaSet: PDF / net, PDF picture.

Neighbors

NA(a) = { b, d, f }
NA(b) = { a, f }
NA( c) = { b, c, g, g }
NA(e) = { c, f, h }
NA(f) = { k }
NA(h) = { d, l }
NA(j) = { h }
NA(l) = { e, g, h }
NE(e) = { b, g }
NE( c) = { d }
NE(f) = { h }

N(v) = NA(v) ∪ NE(v)

The line with node's neighbors description has a form: i0, i1, i1, …, ik with a meaning: the node i0 has neighbors i1, i1, …, ik.

*Vertices  12
  1 "a"   0.1020  0.3226
  2 "b"   0.2860  0.0876
  3 "c"   0.5322  0.2304
  4 "d"   0.3259  0.3917
  5 "e"   0.5543  0.4770
  6 "f"   0.1552  0.6406
  7 "g"   0.8293  0.3249
  8 "h"   0.4479  0.6866
  9 "i"   0.8204  0.8203
 10 "j"   0.4789  0.9055
 11 "k"   0.1175  0.9032
 12 "l"   0.7095  0.6475
*Arcslist
  1  2  4  6
  2  1  6
  3  2  3  7  7
  5  3  6  8
  6 11
  8  4 12
 10  8
 12  5  7  8
*Edgeslist
  2  5
  3  4
  5  7
  6  8

GraphList: PDF / net; TinaList: PDF / net.

Matrix

Our network can be also described using a matrix.

    a  b  c  d  e  f  g  h  i  j  k  l 
 a  0  1  0  1  0  1  0  0  0  0  0  0 
 b  1  0  0  0  1  1  0  0  0  0  0  0 
 c  0  1  1  1  0  0  2  0  0  0  0  0 
 d  0  0  1  0  0  0  0  0  0  0  0  0 
 e  0  1  1  0  0  1  1  1  0  0  0  0 
 f  0  0  0  0  0  0  0  1  0  0  1  0 
 g  0  0  0  0  1  0  0  0  0  0  0  0 
 h  0  0  0  1  0  1  0  0  0  0  0  1 
 i  0  0  0  0  0  0  0  0  0  0  0  0 
 j  0  0  0  0  0  0  0  1  0  0  0  0 
 k  0  0  0  0  0  0  0  0  0  0  0  0 
 l  0  0  0  0  1  0  1  1  0  0  0  0 

Graph G is simple if in the corresponding matrix all entries are 0 or 1.

In general, a matrix entry can be any real number. Each matrix line should be written in a single line with at least one space between entries as a separator.

*Vertices  12
  1 "a"    0.1020  0.3226
  2 "b"    0.2860  0.0876
  3 "c"    0.5322  0.2304
  4 "d"    0.3259  0.3917
  5 "e"    0.5543  0.4770
  6 "f"    0.1552  0.6406
  7 "g"    0.8293  0.3249
  8 "h"    0.4479  0.6866
  9 "i"    0.8204  0.8203
 10 "j"    0.4789  0.9055
 11 "k"    0.1175  0.9032
 12 "l"    0.7095  0.6475
*Matrix
 0 1 0 1 0 1 0 0 0 0 0 0
 1 0 0 0 1 1 0 0 0 0 0 0
 0 1 1 1 0 0 2 0 0 0 0 0
 0 0 1 0 0 0 0 0 0 0 0 0
 0 1 1 0 0 1 1 1 0 0 0 0
 0 0 0 0 0 0 0 1 0 0 1 0
 0 0 0 0 1 0 0 0 0 0 0 0
 0 0 0 1 0 1 0 0 0 0 0 1
 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 0 0 0 1 0 0 0 0
 0 0 0 0 0 0 0 0 0 0 0 0
 0 0 0 0 1 0 1 1 0 0 0 0

GraphMat: PDF / net; TinaMat: PDF / net, paj.

Special types of networks

Two mode networks

The southern women event participation data (Davis) page.

Multirelational networks

Temporal networks

Extended format

pajek/faq/format.txt · Last modified: 2017/05/20 21:49 by vlado
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki