vcount(g) |
count the number of vertices
|
ecount(g) |
count the number of edges
|
neighbors(g,v) |
list the neighbors of a vertex
|
incident(g,v) |
list the incident edges of a vertex
|
is.directed(g) |
determine whether the graph is directed
|
are.connected(g,v1,v2) |
determine whether there is an edge between two vertices
|
get.edge(g,id) |
get endpoints of an edge
|
get.edges(g,es) |
get endpoints of a list of edges
|
|
In the following functions,
? can be graph, vertex or edge. |
get.?.attribute(g,n) |
set.?.attribute(g,n,v) |
list.?.attributes(g) |
?.attributes(g) |
remove.?.attribute(g,n) |
graph.empty() |
|
graph.star(n) |
|
graph.lattice(c(n,m)) |
|
graph.ring(n) |
|
graph.tree(n) |
|
graph.full(n) |
|
graph.full.citation(n) |
|
graph.atlas(0-1252) |
|
graph(c(1,2,2,3,3,4,...)) |
|
graph.edgelist(edge.matrix) |
|
graph.formula(1-2,3,4-+5) |
V(g) |
list vertices in a
igraph.vs object |
V(g)$number |
get or set vertices properties
|
V(g)[number<50] |
get a subset of vertices
|
E(g) |
list edges in a
igraph.es object |
g[] |
get and set adjacency matrix
|
g[[]] |
get adjacency list
|
degree(g) |
|
degree.distribution(g) |
graph.union(g1,g2) |
|
graph.difference(g1,g2) |
summary(g) |
summary
|
str(g) |
summary with edge list
|
print(g) |
customizable printing function
|
neighborhood.size(g,o) |
gives a list of neighborhood size for each vertex
|
neighborhood(g,o) |
gives a list of neighborhood vertices for each vertex
|
graph.neighborhood(g,o) |
gives the neighborhood graphs
|
connect.neighborhood(g,o) |
creates a new graph by connect each vertex with its neighbor vertices
|
good cheat sheet
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.