Skip to content

pratikkulkarni228/overlapping-cluster-removal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

overlapping-cluster-removal

Welcome to the cluster-removal micro-project repository.

Following is the problem statemet: You are given a list of tuples of the form ( x, y, r,) (let's call these c-tuples). Each c-tuple represents a circle on a rectangular coordinate space, with x and y being the coordinates of the center and r being the radius. Assume that each c-tuple has a unique radius.

Let a cluster of circles be a group of circles where each circle in the group overlaps with atleast one other circle in that group. Formally, first let a path be formed between two circles when they overlap. Define a cluster as a group of n circles, where each circle is reachable from every other circle through the formed paths.

Write a python script that does the following: Foreachcluster,the circle with the largest area is kept, and all other circles in that cluster are removed. Return the resulting list of c-tuples. Some examples are shown.

The solution makes use of Disjoint sets to clearly seperate multiple clusters, which is crucial. Cluster example

About

This is a micro project for my algorithms class.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages