igraph a package for network analysis G a bor Cs a rdi - - PowerPoint PPT Presentation

igraph a package for network analysis
SMART_READER_LITE
LIVE PREVIEW

igraph a package for network analysis G a bor Cs a rdi - - PowerPoint PPT Presentation

igraph a package for network analysis G a bor Cs a rdi Gabor.Csardi@unil.ch Department of Medical Genetics, University of Lausanne, Lausanne, Switzerland Outline 1. Why another graph package? 2. igraph architecture, data model and


slide-1
SLIDE 1

igraph – a package for network analysis

G´ abor Cs´ ardi

Gabor.Csardi@unil.ch Department of Medical Genetics, University of Lausanne, Lausanne, Switzerland

slide-2
SLIDE 2

Outline

  • 1. Why another graph package?
  • 2. igraph architecture, data model and data representation
  • 3. Manipulating graphs
  • 4. Features and their time complexity

igraph – a package for network analysis 2

slide-3
SLIDE 3

Why another graph package?

  • graph is slow. RBGL is slow, too.

?

1

> ba2 # graph & RBGL

2

A graphNEL graph with undirected edges

3

Number of Nodes = 100000

4

Number of Edges = 199801

slide-4
SLIDE 4

Why another graph package?

  • graph is slow. RBGL is slow, too.

?

1

> ba2 # graph & RBGL

2

A graphNEL graph with undirected edges

3

Number of Nodes = 100000

4

Number of Edges = 199801

5

> system.time(RBGL::transitivity(ba2))

6

user system elapsed

7

7.517 0.000 7.567

slide-5
SLIDE 5

Why another graph package?

  • graph is slow. RBGL is slow, too.

?

1

> ba2 # graph & RBGL

2

A graphNEL graph with undirected edges

3

Number of Nodes = 100000

4

Number of Edges = 199801

5

> system.time(RBGL::transitivity(ba2))

6

user system elapsed

7

7.517 0.000 7.567

8

> summary(ba) # igraph

9

Vertices: 1e+05

10

Edges: 199801

11

Directed: FALSE

12

No graph attributes.

13

No vertex attributes.

14

No edge attributes.

slide-6
SLIDE 6

Why another graph package?

  • graph is slow. RBGL is slow, too.

?

1

> ba2 # graph & RBGL

2

A graphNEL graph with undirected edges

3

Number of Nodes = 100000

4

Number of Edges = 199801

5

> system.time(RBGL::transitivity(ba2))

6

user system elapsed

7

7.517 0.000 7.567

8

> summary(ba) # igraph

9

Vertices: 1e+05

10

Edges: 199801

11

Directed: FALSE

12

No graph attributes.

13

No vertex attributes.

14

No edge attributes.

15

> system.time(igraph::transitivity(ba))

16

user system elapsed

17

0.328 0.000 0.335

igraph – a package for network analysis 3

slide-7
SLIDE 7

Why another graph package?

  • sna is slow. network is slow, too.

1

> net2 # SNA & network

2

Network attributes:

3

vertices = 1e+05

4

directed = TRUE

5

hyper = FALSE

6

loops = FALSE

7

multiple = FALSE

8

bipartite = FALSE

9

total edges= 199801

10

missing edges= 0

11

non-missing edges= 199801

12

...

slide-8
SLIDE 8

Why another graph package?

  • sna is slow. network is slow, too.

1

> net2 # SNA & network

2

Network attributes:

3

vertices = 1e+05

4

directed = TRUE

5

hyper = FALSE

6

loops = FALSE

7

multiple = FALSE

8

bipartite = FALSE

9

total edges= 199801

10

missing edges= 0

11

non-missing edges= 199801

12

...

13

> gtrans(net2)

14

Error in matrix(0, nr = network.size(x), nc = network.size(x)) :

15

too many elements specified

igraph – a package for network analysis 4

slide-9
SLIDE 9

Why another graph package?

  • graph is slow. RBGL is slow, too.
  • sna is slow. network is slow, too.
  • A generic solution was needed, i.e. a common C layer, that can be interfaced from

C/C++, R, Python, etc.

slide-10
SLIDE 10

Why another graph package?

  • graph is slow. RBGL is slow, too.
  • sna is slow. network is slow, too.
  • A generic solution was needed, i.e. a common C layer, that can be interfaced from

C/C++, R, Python, etc.

graph library core GNU R Python Ruby

igraph – a package for network analysis 5

slide-11
SLIDE 11

The igraph architecture

API igraph_t API utility types igraph library R glue layer R functions converter

igraph – a package for network analysis 6

slide-12
SLIDE 12

Dependencies

  • Standard C/C++ libraries.
slide-13
SLIDE 13

Dependencies

  • Standard C/C++ libraries.
  • stats package, this is part of base.
slide-14
SLIDE 14

Dependencies

  • Standard C/C++ libraries.
  • stats package, this is part of base.
  • Optional: libxml2 library, for reading

GraphML files (included in Windows builds).

slide-15
SLIDE 15

Dependencies

  • Standard C/C++ libraries.
  • stats package, this is part of base.
  • Optional: libxml2 library, for reading

GraphML files (included in Windows builds).

  • Optional: GMP library, graph automorphisms

(not included in Windows builds).

slide-16
SLIDE 16

Dependencies

  • Standard C/C++ libraries.
  • stats package, this is part of base.
  • Optional: libxml2 library, for reading

GraphML files (included in Windows builds).

  • Optional: GMP library, graph automorphisms

(not included in Windows builds).

  • Suggested packages: stats4, rgl, tcltk, RSQLite,

digest, graph, Matrix.

igraph – a package for network analysis 7

slide-17
SLIDE 17

The igraph data model, what cannot be represented

“Mixed”graphs, with undirected and directed edges. You can“emulate”them via graph attributes.

slide-18
SLIDE 18

The igraph data model, what cannot be represented

“Mixed”graphs, with undirected and directed edges. You can“emulate”them via graph attributes.

  • Hypergraphs. Perhaps see the hypergraph package.
slide-19
SLIDE 19

The igraph data model, what cannot be represented

“Mixed”graphs, with undirected and directed edges. You can“emulate”them via graph attributes.

  • Hypergraphs. Perhaps see the hypergraph package.

No direct support for bipartite (two-mode) graphs. It is possible to handle them via graph attributes.

igraph – a package for network analysis 8

slide-20
SLIDE 20

Graph representation, sparse graphs

Flat data structures, indexed edge lists. Easy to handle, good for many kind of questions.

igraph – a package for network analysis 9

slide-21
SLIDE 21

Graph representation, sparse graphs

Flat data structures, indexed edge lists. Easy to handle, good for many kind of questions.

igraph – a package for network analysis 10

slide-22
SLIDE 22

Graph representation, sparse graphs

Flat data structures, indexed edge lists. Easy to handle, good for many kind of questions.

igraph – a package for network analysis 11

slide-23
SLIDE 23

Graph representation, sparse graphs

Flat data structures, indexed edge lists. Easy to handle, good for many kind of questions.

igraph – a package for network analysis 12

slide-24
SLIDE 24

Graph representation, sparse graphs

Flat data structures, indexed edge lists. Easy to handle, good for many kind of questions.

X

A B C D E F G H I J

igraph – a package for network analysis 13

slide-25
SLIDE 25

Graph representation, sparse graphs

Flat data structures, indexed edge lists. Easy to handle, good for many kind of questions.

X

A B C D E F G H I J

X

A B C D E F G H I J

igraph – a package for network analysis 14