constrain based dynamic geometry generation [closed]

I have a bounding box of 1000m x 1000m. I randomly generate 10000 points (sites) inside it. Now, how can I create 'n' polygons (geometries) within the bounding box based on a given constrain.

The constrain could be anything. For example:

1. number of sites inside each polygon are same for all polygons
2. sum of distances from points inside the geometry to the centroid of geometry are same for all polygons
3. let's say, I assign a weight to each site then constrain i sum of weights inside each polygon are same for all polygons
4. area of each polygon is same
5. etc.

Is there a way to generate such a geometry?

P.S. -- would be great if someone can also point me in the right direction and then give down vote.

• Yes, but the best way depends on what the particular constraint is, so you need to be more specific. What's the actual problem you're trying to solve? Commented Jul 15, 2017 at 12:27
• Thanks @DanHulme, let's say, I would like to have it for first constrain. I am a novice in this area so probably, not even sure if I am looking in the right direction. Commented Jul 15, 2017 at 12:47
• If you edit the question to show just a single question, it will be better received and it will be easier for people to write good answers. You can then post the other points as separate questions later. Commented Jul 16, 2017 at 16:12