summaryrefslogtreecommitdiff
path: root/doc/pm.md
blob: 3dea06b5ffa219ca3cc10ead9c928f06230c57ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
pm(1) -- Compute the leading eigenvalue and eigenvector of a graph
======

## SYNOPSIS

`pm` <graph_in> <is_dir> <eps>

## DESCRIPTION

`pm` computes the leading eigenvalue and the corresponding eigenvector
of the matrix given as input, using the Power Method. In particular,
this implementation uses the Rayleigh iteration, which allows faster
convergence on undirected graphs. 

## PARAMETERS

* <graph_in>:
    input graph (edge list) if equal to `-` (dash), read the edge list
    from STDIN (standard input).

* <is_dir>:
    set either to `0` (zero) for undirected graphs, or to `1` (one)
    for directed graphs.

* <eps>: 
    Required relative error on the approximation of the leading
    eigenvalue. The program terminates when the relative change in the
    approximation of the eigenvalue is smaller than `eps`

## EXAMPLES

The following command:

          $ pm er_1000_5000.net 0 0.0000001

computes the leading eigenvalue and the corresponding eigenvector of
the undirected graph stored in the file `er_1000_5000.txt`. We can
store the leading eigenvector in a file, e.g. by using the command:

          $ pm er_1000_5000.net 0 0.0000001 > er_1000_5000.net_eig
          11.0335794552533
          $

which will save the leading eigenvector in the file
`er_1000_5000.net_eig`, one component for each row, and shown on
output the leading eigenvalue of the graph.

## REFERENCES 

* V\. Latora, V. Nicosia, G. Russo, "Complex Networks: Principles,
  Methods and Applications", Appendix 5, Cambridge University Press
  (2017)


## AUTHORS

(c) Vincenzo 'KatolaZ' Nicosia 2009-2017 `<v.nicosia@qmul.ac.uk>`.