JaroslawWiosna / regionalizer

How to choose the best capital of a state and regions? Divider into regions, especially for administrative purposes
Mozilla Public License 2.0
2 stars 2 forks source link

Two regions by brute force - PoC #36

Closed JaroslawWiosna closed 6 years ago

JaroslawWiosna commented 6 years ago

It is more like an idea of How to choose two regions and their capitals than actual solution. I am open to write down a clarification for any part of the code. ...well I have to do this anyway.

JaroslawWiosna commented 6 years ago

By the way, brute force for choosing two regions is not possible when parsing cities_data. There are just too many cities. ...so, the solution would be to limit brute force to...., I don't know, first* 20 cities? I mean, in line 72:

for (; it != vec.end() ; ++it ) {

should be

for (; it != vec.begin()+20 ; ++it ) {

another loops could iterate over the whole vector just like it is done in this patchset


first 20 cities - what I mean is that the vector should be sorted. The city with the greatest population should come first.


I will prepare a new patch set soon.

JaroslawWiosna commented 6 years ago

I think this is ready to be merged. I mean that calculateHappinessLevelForTwoRegionsByBruteForce represents proof of concept here. ...but still Cities separation to two regions needs to be done in more elegant way.