Gaining information about graph structure
|
count the number of vertices |
|
count the number of edges |
|
list the neighbors of a vertex |
|
list the incident edges of a vertex |
|
determine whether the graph is directed |
are.connected(g,v1,v2)
|
determine whether there is an edge between two vertices |
|
get endpoints of an edge |
|
get endpoints of a list of edges |
Graph, vertex and edge attributes
In the following functions, ?
can be graph
, vertex
or edge
. |
|
set.?.attribute(g,n,v)
|
|
|
remove.?.attribute(g,n)
|
Various methods for creating graphs
|
|
graph.lattice(c(n,m))
|
|
|
|
graph.full.citation(n)
|
|
graph(c(1,2,2,3,3,4,...))
|
graph.edgelist(edge.matrix)
|
graph.formula(1-2,3,4-+5)
|
|
|
Vertex and edge sequences and iterators
|
list vertices in a igraph.vs
object |
|
get or set vertices properties |
|
get a subset of vertices |
|
list edges in a igraph.es
object |
Method for structural manipulation of graphs
|
get and set adjacency matrix |
|
get adjacency list |
Degree and degree distribution of the vertices
|
degree.distribution(g)
|
Graph Algebra
|
graph.difference(g1,g2)
|
Print Graph
|
summary |
|
summary with edge list |
|
customizable printing function |
Neighborhood of graph vertices
neighborhood.size(g,o)
|
gives a list of neighborhood size for each vertex |
|
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 |
|
Created By
Metadata
Favourited By
Comments
14:03 10 Dec 18
good cheat sheet
Add a Comment
Related Cheat Sheets