File: structural-properties.md

package info (click to toggle)
r-cran-igraph 2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,772 kB
  • sloc: ansic: 206,420; cpp: 21,827; fortran: 4,090; yacc: 1,229; lex: 518; sh: 52; makefile: 8
file content (79 lines) | stat: -rw-r--r-- 1,883 bytes parent folder | download
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# dfs() deprecated arguments

    Code
      d <- dfs(g, root = 2, unreachable = FALSE, neimode = "out", father = TRUE)
    Condition
      Error:
      ! The `neimode` argument of `dfs()` was deprecated in igraph 1.3.0 and is now defunct.
      i Please use the `mode` argument instead.

# bfs() works

    Code
      g <- graph_from_literal(a - +b - +c, z - +a, d)
      bfs(g, root = 2, mode = "out", unreachable = FALSE, order = TRUE, rank = TRUE,
        parent = TRUE, pred = TRUE, succ = TRUE, dist = TRUE)
    Output
      $root
      [1] 2
      
      $mode
      [1] "out"
      
      $order
      + 2/5 vertices, named:
      [1] b c
      
      $rank
      a b c z d 
      0 1 2 0 0 
      
      $parent
      + 5/5 vertices, named:
         a    b    c    z    d 
      <NA> <NA>    b <NA> <NA> 
      
      $pred
      + 5/5 vertices, named:
         a    b    c    z    d 
      <NA> <NA>    b <NA> <NA> 
      
      $succ
      + 5/5 vertices, named:
         a    b    c    z    d 
      <NA>    c <NA> <NA> <NA> 
      
      $dist
       a  b  c  z  d 
      -1  0  1 -1 -1 
      
      $neimode
      [1] "out"
      
      $father
      + 5/5 vertices, named:
         a    b    c    z    d 
      <NA> <NA>    b <NA> <NA> 
      

# bfs() deprecated arguments

    Code
      b <- bfs(g, root = 2, neimode = "out", unreachable = FALSE, order = TRUE, rank = TRUE,
        father = TRUE, pred = TRUE, succ = TRUE, dist = TRUE)
    Condition
      Error:
      ! The `neimode` argument of `bfs()` was deprecated in igraph 1.3.0 and is now defunct.
      i Please use the `mode` argument instead.

# laplacian_matrix() works

    Code
      laplacian_matrix(Ai, normalization = "unnormalized")
    Output
      3 x 3 sparse Matrix of class "dgCMatrix"
                         
      [1,]  410 -210 -200
      [2,] -210  590 -380
      [3,] -200 -380  580