DBSCAN Clustering Worked Example: Find Dense Clusters and Mark Noise Points by Hand

Work through DBSCAN by hand on 11 labelled points. Build every neighbourhood, expand two density-connected clusters, mark one noise point, and test how the parameters change the result.

KnowledgeGate Team

Exam prep & CS education

Updated 26 Nov 20265 min read
DBSCAN Clustering Worked Example: Find Dense Clusters and Mark Noise Points by Hand

A scatter plot may look as if it contains two groups and one outlier, but DBSCAN will not accept that visual guess. Every label must follow from one distance threshold and one density count. All 11 labelled points use epsilon = 1.1 and MinPts = 3, including the point itself. The result is cluster 1 {A,B,C,D,E}, cluster 2 {F,G,H,I,J}, and noise {N}.

1. DBSCAN clustering replaces centroids with local density

DBSCAN expands to Density-Based Spatial Clustering of Applications with Noise. It takes a distance function, an epsilon radius, and MinPts. Unlike K-means, it requests no cluster count and moves no centroids. It finds connected dense regions while leaving isolated points as noise. ML & Data Science places this calculation inside the wider subject.

The closed epsilon neighbourhood of point p is

N_epsilon(p) = {q : d(p,q) <= epsilon}.

We use Euclidean distance, d(p,q) = sqrt((p_x-q_x)^2 + (p_y-q_y)^2). A point exactly on the epsilon boundary is included.

2. DBSCAN core, border and noise points have different jobs

A core point has at least MinPts points in its epsilon neighbourhood, including itself here. A border point is not core but lies in a core point's neighbourhood. Noise is neither core nor border after expansion.

A cluster expands through core points with overlapping neighbourhoods. A border point joins but does not continue expansion, so cluster members need not all be within epsilon of one another.

A sparse point visited early may be provisional noise, then become border when a core point reaches it. Final noise is never reached. Traversal order can decide which cluster claims a shared border point, but core-connected components remain stable.

3. Build every epsilon neighbourhood for the 11-point dataset

Use these coordinates:

Point

Coordinate

Point

Coordinate

A

(0,0)

F

(6,0)

B

(1,0)

G

(7,0)

C

(2,0)

H

(6,1)

D

(2,1)

I

(7,1)

E

(2,2)

J

(8,1)

N

(4,3)

With epsilon = 1.1 and MinPts = 3, counting self, the full audit is:

Point

N_1.1(point)

Count

Final type

A

{A,B}

2

border

B

{A,B,C}

3

core

C

{B,C,D}

3

core

D

{C,D,E}

3

core

E

{D,E}

2

border

F

{F,G,H}

3

core

G

{F,G,I}

3

core

H

{F,H,I}

3

core

I

{G,H,I,J}

4

core

J

{I,J}

2

border

N

{N}

1

noise

Check three distances. d(B,C) = 1 <= 1.1, so C is included. d(B,D) = sqrt(2), about 1.414 > 1.1, so D is excluded. d(N,E) = sqrt(5), about 2.236 > 1.1; all other points are farther from N, so N sees only itself. A, E, and J fail the core test, then become border because a core reaches them.

4. Run DBSCAN expansion and obtain the final labels

Start at core B. Seed {A,B,C} begins cluster 1. Border A adds nothing. Core C contributes {B,C,D}, then core D contributes {C,D,E}. Border E stops the branch. Cluster 1 is {A,B,C,D,E}.

F starts cluster 2 with {F,G,H}. Cores G and H bring in I. Core I has {G,H,I,J}, so border J joins without expanding. Cluster 2 is {F,G,H,I,J}. N has count 1 and no core reaches it.

Final ledger: core B,C,D,F,G,H,I; border A,E,J; noise N; cluster 1 {A,B,C,D,E}; cluster 2 {F,G,H,I,J}. If A is visited first, count 2 can mark it provisional noise. B's expansion then reassigns it as border.

5. DBSCAN keeps the bent cluster and refuses to force the outlier

d(A,E) = sqrt(8), about 2.828 > 1.1. Yet A and E share the L-shaped chain A-B-C-D-E, expanded by cores B, C, and D. DBSCAN preserves this density-connected shape without one centre.

Centroids are only a comparison. The means of A to E and F to J are (1.4,0.6) and (6.8,0.6). From N=(4,3), their distances are sqrt(12.52), about 3.538, and sqrt(13.60), about 3.688. A nearest-centroid rule forces N towards group 1; DBSCAN leaves it unassigned because no dense neighbourhood reaches it.

DBSCAN suits density-connected, non-spherical groups with outliers when one density scale is meaningful. Different cluster densities or high-dimensional distances can defeat it. Unsupervised Learning and Clustering Explained: K-Means Worked Example and Exam Traps owns representation, scaling, distance choice, K-means, and algorithm comparison; this worked example owns the full epsilon-neighbourhood audit and DBSCAN expansion trace. This toy case does not prove DBSCAN universally better than K-means.

6. Choose epsilon, MinPts and feature scale as one decision

Keep MinPts = 3. At epsilon = 0.9, unit-spaced neighbours are outside, so all 11 points are noise. At 1.1, two clusters remain with N as noise. At 3.0, N has {D,E,H,N}, count 4, becomes core, and bridges both core components. Too small fragments; too large merges.

At epsilon = 1.1, raise MinPts to 4. Only I is core; G, H, and J are its borders. F is noise because it is farther than 1.1 from I, and A to E are noise. Higher MinPts demands stronger support.

If only x is multiplied by 100, d(A,B) changes from 1 to 100 while d(C,D) stays 1. Horizontal links disappear at epsilon = 1.1. Features need comparable, meaningful scales. A sorted nearest-neighbour, or k-distance, plot can suggest epsilon candidates, but domain and stability checks must confirm them. Skill Development Courses is the route for broader applied study.

Three scatter plots compare epsilon 0.9, 1.1, and 3.0, producing all noise, two clusters, then one cluster bridged by N.

7. DBSCAN calculation traps and assessment-style checks

Trap

Fix

Count only other points

Write MinPts includes self beside the parameters.

Expand from a border point

Expand neighbourhoods only from core points.

Treat provisional noise as permanent

Check whether later core expansion reaches it.

Use < epsilon after defining <= epsilon

Apply the closed-boundary rule consistently.

Compare raw features with incompatible units

Choose a meaningful scale before measuring distance.

Test the worked values directly:

  1. Why is A border, not core? {A,B} has count 2, but A is one unit from core point B.

  2. Why can A and E share a cluster when d(A,E) = sqrt(8)? The core chain through B, C, and D makes them density-connected.

  3. What happens to N at epsilon = 3.0? {D,E,H,N} has count 4, so N is core and joins the components.

Common tasks classify points, trace expansion, separate border from noise, or compare settings. Record the metric and self-count rule, build neighbourhoods, mark cores, attach borders, expand core components, then label unreached points as noise.

8. DBSCAN clustering: the short version and next step

Use this six-step chain: choose a meaningful metric and scale; form every closed epsilon neighbourhood; mark points with count at least MinPts as core; connect overlapping core neighbourhoods; attach reachable non-core points as border; leave unreached points as noise. Here the result at epsilon = 1.1, MinPts = 3 including self is cluster 1 {A,B,C,D,E}, cluster 2 {F,G,H,I,J}, and noise {N}.

Hide the table and reconstruct C, I, and N. Explain why C and I expand while N does not, then predict the epsilon = 0.9 and 3.0 outcomes before checking section 6.

For structured wider study, continue with AI & ML for Placements. Write the conventions, calculate every neighbourhood, and let density determine the labels.