Tutorial 3: Pajek basics Qi YU. Getting started Data format in Pajek Window tools in Pajek…

Preview:

DESCRIPTION

 Getting started  Data format in Pajek  Window tools in Pajek  Resources

Citation preview

INFROMETRIC METHODS SEMINARTutorial 3: Pajek basicsQi YU

CONTENTS Getting started Data format in Pajek Window tools in Pajek Resources

CONTENTS Getting started Data format in Pajek Window tools in Pajek Resources

INTORDUCTION Pajek is a program, for Windows, for analysis and visualization of large

networks having some thousands or even millions of vertices. In Slovenian language the word pajek means spider.

APPLICATION Pajek should provide tools for analysis and visualization of such networks:

collaboration networks, organic molecule in chemistry, protein-receptor interaction networks, genealogies, Internet networks, citation networks, diffusion (AIDS, news, innovations) networks, data-mining (2-mode networks), etc.

See also collection of large networks at: http://vlado.fmf.uni-lj.si/pub/networks/data/

Approaches to deal with large networks

MAIN GOALS to support abstraction by (recursive) decomposition of a large network into

several smaller networks that can be treated further using more sophisticated methods;

to provide the user with some powerful visualization tools; to implement a selection of efficient (subquadratic) algorithms for analysis

of large networks.

CONTENTS Getting started Data format in Pajek Window tools in Pajek Resources

SIX DATA STRUCTURES IN PAJEK 1. network – main object (vertices and lines - arcs, edges):

- graph, valued network, multirelational, 2-mode or temporal network 2. partition

- they tell for each vertex to which class vertex belong. Default extension: .clu 3. vector

- they tell for each vertex some numerical property (real number). Default extension: .vec 4. permutation – reordering of vertices

- reordering of vertices. Default extension: .per 5. cluster

- subset of vertices (e.g. one class from partition). Default extension: .cls. 6. hierarchy

- hierarchically vertices. Default extension: .hie

NETWORK – .NET Network can be defined in different ways on input file. Look at three of them: 1. List of neighbours (Arcslist / Edgeslist)(see test 1.net)

*Vertices 51 ”a”2 ”b”3 ”c”4 ”d”5 ”e”*Arcslist1 2 42 33 1 44 5*Edgeslist1 5

EXPLANATION Data must be prepared in an input (ASCII) file. Program NotePad can be used for

editing. Much better is a shareware editor, TextPad. Words, starting with *, must always be written in first column of the line. They

indicate the start of a definition of vertices or lines. Using *Vertices 5 we define a network with 5 vertices. This must always be the first

statement in definition of a network. Definition of vertices follows after that – to each vertex we give a label, which is

displayed between “ and ”. Using *Arcslist, a list of directed lines from selected vertices are declared (1 2 4

means, that there exist two lines from vertex 1, one to vertex 2 and another to vertex 4).

Similarly *Edgeslist, declares list of undirected lines from selected vertex. In the file no empty lines are allowed – empty line means end of network.

NETWORK – .NET 2. Pairs of lines (Arcs / Edges) (see test 2.net)

*Vertices 51 ”a”2 ”b”3 ”c”4 ”d”5 ”e”*Arcs1 2 11 4 12 3 23 1 13 4 24 5 1*Edges1 5 1

EXPLANATION Directed lines are defined using *Arcs, undirected lines are defined using

*Edges. The third number in rows defining arcs/edges gives the value of the arc/edge.

In the previous format (Arcslist / Edgeslist) values of lines cannot be defined – the format is suitable only if all values of lines are 1.

If values of lines are not important the third number can be omitted (all lines get value 1).

In the file no empty lines are allowed – empty line means end of network.

NETWORK – .NET 3.Matrix (see test 3.net)

*Vertices 51 ”a”2 ”b”3 ”c”4 ”d”5 ”e”*Matrix0 1 0 1 10 0 2 0 01 0 0 2 00 0 0 0 11 0 0 0 0

EXPLANATION In this format directed lines (arcs) are given in the matrix form (*Matrix). If

we want to transform bidirected arcs to edges we can use “Net>Transform>Arcs to Edges>Bidirected only”

ADDITIONAL DEFINITION OF NETWORK Only those elements necessary to define structure of network were

described so far. Additionally, Pajek enables precise definition of elements used for drawing networks (coordinates of vertices, shapes and colors of vertices and lines, ...).

Example: (see test 4.net)*Vertices 51 “a” box2 “b” ellipse3 “c” diamond4 “d” triangle5 “e” empty...

INTERACTIVE DEFINITION OF NETWORKS Simple networks can be defined inside program Pajek as well without

definition in an input file: Select: “Net>Random Network>Total No. of Arcs”

PARTITION – .CLU Partitions are used to describe nominal properties of vertices.

e.g., 1-men, 2-women Definition in input file (see test.clu)*Vertices 512221

INTERACTIVE DEFINITION OF PARTITIONS We can build a partition using Pajek too:

Use "Partition>Create Null Partition”, or Select “Draw>Draw-SelectAll”

Using that command three operations are executed: a new partition of equal dimension as the number of vertices is generated; all vertices are put to cluster 0, and the network is drawn using the obtained null partition (all vertices are cyan).

VECTOR – .VET Vectors are used to describe numerical properties of vertices (e.g.,

centralities). Definition in input file (see test.net)*Vertices 50.580.250.250.080.25

PAJEK PROJECT FILES Often it is the case that not only network but also several properties of the

vertices are known in advance. This properties are usually stored as partitions or vectors. It is time consuming to load objects one by one. Therefore it is convenient to store all data in one file, called Pajek project file (.paj). (see test.paj)

Project files can be produced manually by using “File>Pajek Project File>Save”

To load objects stored in Pajek project file select “File>Pajek Project File>Read”

CONTENTS Getting started Data format in Pajek Window tools in Pajek Resources

MENU STRUCTURE The Main screen menus have a clear

logic. Manipulations that involve one type of

data object are listed under a menu with the object’s name; For example, the Net menu contains all

commands that operate on one network and the Nets menu lists operations on two networks.

Manipulations that need different kinds of objects are listed in the Operations menu. For example, if we want to extract a sub-

network that consists of men from the original network file, two kinds of files are needed, that is the original network file and the partition file in which each vertex is assigned to the class “men” or “women”. Then we should select the option “operations>extract from network>partition”

MOST USED MENU FILE NET OPERATIONS PARTITION VECTOR DRAW INFO

SOME COMMANDS IN DRAW WINDOW Options>Mark vertices using

selects the way vertices are marked inthe picture Options>Lines

visibility or nonvisibiliy of arcs and edges, selects the way lines are marked in the picture

Options>Size selects the size of vertices, size of font, size of arrows and width of lines

Options>Colors selects background color, color of vertices, lines, font. . .

CONTENTS Getting started Data format in Pajek Window tools in Pajek Resources

RESOURCES Download

The latest version of Pajek is freely available, for non-commercial use, at its home page: http://vlado.fmf.uni-lj.si/pub/networks/pajek/

Text file into Pajek http://vlado.fmf.uni-lj.si/pub/networks/pajek/howto/text2pajek.htm

WoS to Pajek http://vlado.fmf.uni-lj.si/pub/networks/pajek/WoS2Pajek/default.htm

Tutorial Exploratory Social Network Analysis with Pajek

visit Pajek wiki for more information http://pajek.imfm.si/doku.php

Recommended