I have a list of shapely polygons present in a list (around 12k). Many of the polygons in this list overlap with each other. The task I need to perform is to create a dictionary with the indexes of polygon which satisfy a certain overlapping threshold. For e.g. if polygon1 overlaps with polygon5 and polygon6 and polygon2 overlaps with polygon10 and polygon3, polygon4 does not overlap with any other polygon then the dictionary should be like
{1: [5, 6],
2: [3, 10],
3: [],
}
The overlapping criteria used to determine if the polygons should be merged is intersection of the polygons divided by the area of the smaller polygon. Also, getting a list of all the merged polygons will also help.