| make_full_multipartite | R Documentation |
A multipartite graph contains multiple types of vertices and connections are only possible between vertices of different types. This function creates a complete multipartite graph where all possible edges between different partitions are present.
make_full_multipartite(n, directed = FALSE, mode = c("all", "out", "in"))
full_multipartite(n, directed = FALSE, mode = c("all", "out", "in"))
n |
A numeric vector giving the number of vertices in each partition. |
directed |
Logical scalar, whether to create a directed graph. |
mode |
Character scalar, the type of connections for directed graphs.
If |
An igraph graph with a vertex attribute type storing the
partition index of each vertex. Partition indices start from 1.
Other deterministic constructors:
graph_from_atlas(),
graph_from_edgelist(),
graph_from_literal(),
make_(),
make_chordal_ring(),
make_circulant(),
make_empty_graph(),
make_full_citation_graph(),
make_full_graph(),
make_graph(),
make_lattice(),
make_ring(),
make_star(),
make_tree(),
make_turan(),
make_wheel()
# Create a multipartite graph with partitions of size 2, 3, and 4
g <- make_full_multipartite(c(2, 3, 4))
plot(g)
# Create a directed multipartite graph
g2 <- make_full_multipartite(c(2, 2, 2), directed = TRUE, mode = "out")
plot(g2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.