<p>I ran across a problem while working on an algorithm for a game I'm making on the side. It's basically a clustering problem where we have a graph G and want to split it into clusters of equal size where each cluster is a connected subgraph of G. I also wanted to minimize the number of clusters and keep some guarantees about their size. The graph will also change over time so I want some quick way to add and remove vertices and maintain the clustering properties I created for the original clusters.</p>

<p>I'm working on this myself at the moment but I don't want to waste time if there already exists some sort of solution for this problem or if I'm overlooking an easy solution. If y'all have any helpful algorithms or papers you could refer me to, that would be amazing. Also, if you straight up solve this, that would be great as well.</p>

<p>Here's a formalization of the problems: </p>

<p><strong>Cluster Property</strong>: given undirected graph G = (V, E) with vertices V and edges E and a set of clusters $C=\{C_1, ..., C_n\}$ where each $C_k=(E_k, V_k)$, $C$ holds the following properties:</p>

<ul>
<li>$|C_k| \le a*ceil(\sqrt{|V|})$ where ceil is the ceiling function that rounds to up</li>
<li>$n$ is minimized for graph $G$</li>
<li>$C_k$ is connected</li>
<li>$V_k \subseteq V$ and $E_k \subseteq E$</li>
<li>the sets $V_1,\ldots,V_n$ are disjoint</li>
<li>$V_1 \cup V_2 ...\cup V_n = V$</li>
</ul>

<p><strong>Problem 1</strong></p>

<p><strong>Input</strong>: an undirected graph $G = (V,E)$</p>

<p><strong>Output</strong>: a set of clusters $C={C_1,...,C_n}$ where $C$ has the Cluster Property</p>

<p><strong>Problem 2</strong></p>

<p><strong>Input</strong>: an undirected graph $G = (V, E)$, a set of clusters $C={C_1,...,C_n}$, and a set of valid edges and vertices to remove $R=(E_R,V_R)$</p>

<p><strong>Output</strong>: a set of clusters $C'={C'_1,...C'_n}$  for graph $G_R=(V-V_R,E-(E_R\cup E_{V_R}))$ where $C'$ maintains the Cluster Property. $E_{V_R}$ is the set of all edges that have an endpoint in $V_R$.</p>

<p><strong>Problem 3</strong></p>

<p><strong>Input</strong>: an undirected graph $G = (V, E)$, a set of clusters $C={C_1,...,C_n}$, and a set of valid edges and vertices to add $R=(E_A,V_A)$</p>

<p><strong>Output</strong>: a set of clusters $C'={C'_1,...C'_n}$  for graph $G_A=(V \cup V_R,E \cup E_A)$ where $C'$ maintains the Cluster Property.</p>

<p><strong>Note</strong>: when adding or removing edges to the graph, assume that valid edges have endpoints in vertices that exist in the final graph.</p>

<p><strong>Edit</strong>: There are a couple extra constraints I have that on the graph that I haven't provided. I'd like to be able to solve this problem for undirected graphs in general but if that's not possible or it's too difficult, I'll be forced to solve it for the specific set of graphs I'm working on. These graphs are Constrained Delaunay Triangulations, I can go into this more if you'd like.</p>

CC BY-SA 3.0
2013-11-27T15:50:43.087Z
I have a few questions. Firstly by the constraint V1∩V2...∩Vn=∅, you want no vertex to be common for all clusters or did you want Vj∩Vi=∅ for i not equal to j?
Vivek Bagaria
CC BY-SA 3.0
2013-11-30T20:49:14.937Z
He must mean no vertex belongs to every cluster, exactly as stated, since otherwise no connected graph has subgraphs satisfying the Cluster Condition.  If the subgraphs partition the vertices, then some edge crosses the partition and thus belongs to no subgraph.  Equivalently, if the subgraphs partition the edges, then some vertex must appear in more than one subgraph.
Jeffε
CC BY-SA 3.0
2013-11-30T23:25:54.597Z
I messed up a part of the cluster condition and edited it. The union of  E1, E2, ... , En doesn't need to be E. The important thing is that each vertex from V is used in exactly one cluster.
CCguy
CC BY-SA 3.0
2013-12-06T01:34:01.343Z
METIS is worth looking at: http://glaros.dtc.umn.edu/gkhome/views/metis

For Delaunay triangulations there should be something easier.  Choose $n$ vertices of the graph at random and see if the vertices in each Voronoi region form a good clustering.  Maybe that's a starting point.
Andrew D. King
<graph-theory><clustering><minimization>
Splitting a graph into size constrained clusters
CCguy
# Splitting a graph into size constrained clusters

(Asked by: username_0 on 2013-11-26)

I ran across a problem while working on an algorithm for a game I'm making on the side. It's basically a clustering problem where we have a graph G and want to split it into clusters of equal size where each cluster is a connected subgraph of G. I also wanted to minimize the number of clusters and keep some guarantees about their size. The graph will also change over time so I want some quick way to add and remove vertices and maintain the clustering properties I created for the original clusters.

I'm working on this myself at the moment but I don't want to waste time if there already exists some sort of solution for this problem or if I'm overlooking an easy solution. If y'all have any helpful algorithms or papers you could refer me to, that would be amazing. Also, if you straight up solve this, that would be great as well.

Here's a formalization of the problems:

**Cluster Property**: given undirected graph G = (V, E) with vertices V and edges E and a set of clusters $C=\{C\_1, ..., C\_n\}$ where each $C\_k=(E\_k, V\_k)$, $C$ holds the following properties:

* $|C\_k| \le a\*ceil(\sqrt{|V|})$ where ceil is the ceiling function that rounds to up
* $n$ is minimized for graph $G$
* $C\_k$ is connected
* $V\_k \subseteq V$ and $E\_k \subseteq E$
* the sets $V\_1,\ldots,V\_n$ are disjoint
* $V\_1 \cup V\_2 ...\cup V\_n = V$

**Problem 1**

**Input**: an undirected graph $G = (V,E)$

**Output**: a set of clusters $C={C\_1,...,C\_n}$ where $C$ has the Cluster Property

**Problem 2**

**Input**: an undirected graph $G = (V, E)$, a set of clusters $C={C\_1,...,C\_n}$, and a set of valid edges and vertices to remove $R=(E\_R,V\_R)$

**Output**: a set of clusters $C'={C'\_1,...C'\_n}$ for graph $G\_R=(V-V\_R,E-(E\_R\cup E\_{V\_R}))$ where $C'$ maintains the Cluster Property. $E\_{V\_R}$ is the set of all edges that have an endpoint in $V\_R$.

**Problem 3**

**Input**: an undirected graph $G = (V, E)$, a set of clusters $C={C\_1,...,C\_n}$, and a set of valid edges and vertices to add $R=(E\_A,V\_A)$

**Output**: a set of clusters $C'={C'\_1,...C'\_n}$ for graph $G\_A=(V \cup V\_R,E \cup E\_A)$ where $C'$ maintains the Cluster Property.

**Note**: when adding or removing edges to the graph, assume that valid edges have endpoints in vertices that exist in the final graph.

**Edit**: There are a couple extra constraints I have that on the graph that I haven't provided. I'd like to be able to solve this problem for undirected graphs in general but if that's not possible or it's too difficult, I'll be forced to solve it for the specific set of graphs I'm working on. These graphs are Constrained Delaunay Triangulations, I can go into this more if you'd like.

**Tags:** graph-theory, clustering, minimization
> **Comments:**
> **username_1**: I have a few questions. Firstly by the constraint V1∩V2...∩Vn=∅, you want no vertex to be common for all clusters or did you want Vj∩Vi=∅ for i not equal to j?  
> **username_2**: He must mean no vertex belongs to every cluster, exactly as stated, since otherwise no connected graph has subgraphs satisfying the Cluster Condition.  If the subgraphs partition the vertices, then some edge crosses the partition and thus belongs to no subgraph.  Equivalently, if the subgraphs partition the edges, then some vertex must appear in more than one subgraph.  
> **username_0**: I messed up a part of the cluster condition and edited it. The union of  E1, E2, ... , En doesn't need to be E. The important thing is that each vertex from V is used in exactly one cluster.  
> **username_3**: METIS is worth looking at: http://glaros.dtc.umn.edu/gkhome/views/metis  For Delaunay triangulations there should be something easier.  Choose $n$ vertices of the graph at random and see if the vertices in each Voronoi region form a good clustering.  Maybe that's a starting point.  

---

## 0 answers

