A bipartite graph has two kinds of vertices and connections are only allowed between different kinds.
is_bipartite(graph) make_bipartite_graph(types, edges, directed = FALSE) bipartite_graph(...)
The input graph.
A vector giving the vertex types. It will be coerced into
boolean. The length of the vector gives the number of vertices in the graph.
When the vector is a named vector, the names will be attached to the graph
A vector giving the edges of the graph, the same way as for the
Whether to create a directed graph, boolean constant. Note that by default undirected graphs are created, as this is more common for bipartite graphs.
Bipartite graphs have a
type vertex attribute in igraph, this is
FALSE for the vertices of the first kind and
for vertices of the second kind.
make_bipartite_graph basically does three things. First it checks the
edges vector against the vertex
types. Then it creates a graph
edges vector and finally it adds the
types vector as
a vertex attribute called
edges may contain strings as
vertex names; in this case,
types must be a named vector that specifies
the type for each vertex name that occurs in
is_bipartite checks whether the graph is bipartite or not. It just
checks whether the graph has a vertex attribute called
make_bipartite_graph returns a bipartite igraph graph. In other
words, an igraph graph that has a vertex attribute named
is_bipartite returns a logical scalar.
Gabor Csardi firstname.lastname@example.org
graph to create one-mode networks
g <- make_bipartite_graph(rep(0:1, length.out=10), c(1:10)) print(g, v=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.