graph_kpartite: k partite graphs

View source: R/graphs.R

graph_kpartiteR Documentation

k partite graphs

Description

Create a complete k-partite graph.

Usage

graph_kpartite(n = 10, grp = c(5, 5))

Arguments

n

number of nodes

grp

vector of partition sizes. Must sum to n.

Value

igraph object with vertex attribute type giving the partition of each vertex

Author(s)

David Schoch

Examples

# 3-partite graph with equal sized groups
graph_kpartite(n = 15, grp = c(5, 5, 5))

netUtils documentation built on Sept. 30, 2026, 5:10 p.m.