This format use NET extension and is easy to use. Attributes support is however missing, only the network topology can be represented with a Pajek File. The structure is easy, Pajek files are text files, where each line is an element, and the list of edges follows the list of nodes. It is supported by nearly most of graph softwares, including Pajek, NodeXL and NetworkX.
The following manual contains documentation about the NET format and several samples.
Pajek Manual |
Nodes
Nodes have basically one unique identifier and a label. The definition of nodes starts with the chain *vertices N where N is the number of nodes following. For instance this is the beginning of a Pajek file of 82670 nodes. Labels are quoted directly after the nodes identifier.
*Vertices 82670
1 "entity"
2 "thing"
3 "anything"
4 "something"
5 "nothing"
6 "whole"
When nodes don’t have labels, the list of identifier is hence useless (only ordered numbers). Thus only the vertices count is set. The importer will create the exact number of edges.
*Vertices 2536
Edges
Edges are either defined as list of nodes identifier or pair of two nodes.
For the first case; edges are defined as pair of nodes identifier. The *arcs marker goes before the pairs list.
*arcs
4244 107
4244 238
4244 4292
4247 107
4248 1
4248 54
Weight is added by a third column, here the weight of the first edge is 5:
*arcs
4244 107 5
For the second scheme, the first identifier is the source node and all following are the neighbors. The dedicated marker is edgeslist.
*edgeslist
4941 386 395 451
1 3553 3586 3587 3637
2 3583
3 4930
4 88
5 13 120
Additional information
* Commentary can be put in Pajek files. A commentary line starts with %.
* The following sample is supported, but only label is taken into account.
*vertices 45
1 "154:codon usage/sequence bias" x_fact 7.2814 y_fact 7.2814 ic RawSienna
2 "156:cytokine bias/t helper" x_fact 7.2814 y_fact 7.2814 ic RawSienna
3 "158:incorporation bias/verification bias" x_fact 7.2814 y_fact 7.2814 ic RawSienna
Sample
*Vertices 9
*Edges
1 2
1 9
2 9
2 3
2 8
3 8
3 4
4 5
4 7
5 7
5 6
6 4