% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generalized_sierpinski.R
\name{generalized_sierpinski}
\alias{generalized_sierpinski}
\title{Generalized Sierpiński graph}
\usage{
generalized_sierpinski(G, n)
}
\arguments{
\item{G}{An igraph object representing the base graph. Its vertices must be
labelled \code{1, 2, ..., k} (as characters or integers).}

\item{n}{Integer, dimension (\eqn{n \ge 1}). \code{n = 1} returns \code{G}.}
}
\value{
An igraph object representing \eqn{S(n, G)}.
}
\description{
Constructs the generalized Sierpiński graph \eqn{S(n, G)} as defined in
"Generalized Sierpiński graphs" (Gravier et al.). The vertex set is
\eqn{\{1,\dots,k\}^n} where \eqn{k = |V(G)|}, and edges are defined
recursively based on the edges of \eqn{G}.
}
\examples{
library(igraph)

# Example 1: Base graph is a 4-cycle
G <- make_ring(4)
S2 <- generalized_sierpinski(G, 2)
plot(S2, vertex.size = 8, vertex.label = NA)

# Example 2: Base graph is a triangle (classical Sierpiński gasket)
G_tri <- make_graph(~ 1-2-3-1)
S3_tri <- generalized_sierpinski(G_tri, 3)
summary(S3_tri)  # vertices: 27, edges: 63

# Example 3: Base graph is a complete graph K4
G_K4 <- make_full_graph(4)
S2_K4 <- generalized_sierpinski(G_K4, 2)
summary(S2_K4)  # vertices: 16, edges: 96
}
\references{
Gravier, Sylvain, Matjaž Kovše, and Aline Parreau. "Generalized Sierpiński graphs." Posters at EuroComb 11 (2011): 2016-0216.
}
