Advanced

Re: GC43JTD - Contiguous Counties 5 states

[Resolved] GC43JTD - Contiguous Counties 5 states
May 26, 2016 10:16PM
We'd like to know if a checker could be developed to verify connecting county to county connecting 5 states together. This is a grandfathered challenge and we have been easily able to verify using the Project-GC county map.

Thanks for your help.
MaxB
Re: GC43JTD - Contiguous Counties 5 states
May 26, 2016 10:44PM
The code to check it is not that hard to code.
The problem is that the checker need a graph of all counties in the US with the name, state and connection to all other neighboring counties. the hard part is to do that.
If you create the connection graph i can code a checker
Re: GC43JTD - Contiguous Counties 5 states
May 28, 2016 12:02AM
Target,

Thanks for your reply, we should have gotten an email, but didn't. Can you help explain what you mean by a connection graph? Can this be done with excel? Or let us know what format it needs to be created in and what program.

Thanks.
Re: GC43JTD - Contiguous Counties 5 states
May 28, 2016 01:11AM
What is needed is a list of which county is connected to each other. The format should be somting in JSON when it is easy to read into lua for the checkers. It is pure text and can be created in a text editor
First a list grouped by states with the county id and names. The name has to be the same as on pgc and the id has to be unique. The id:s have to be u
And then a list for each county which other counties they are connected to
The json can be validate on http://jsonlint.com/
A start with 4 counties in Alabama
{
"States": {
"Alabama": {
"1": "Mobile County (AL)",
"2": "Baldwin County (AL)",
"3": "Washington County (AL)",
"4": "Clarke County (AL)"
}
},
"Connections": {
"1": [2, 3],
"2": [1, 3, 4],
"3": [1, 2, 4],
"4": [2, 3]
}
}

You can reduce the number of connection by only including them from a lower number to a higher number or leave it as above or mix and match it is your choose

"Connections":{
"1":[2,3],
"2":[3,4],
"3":[4]
}
The it for the counties has to be unique so if i take the states in alphabetical order and skips Alaska the firs one will be 68 when Alabama has 67 counties
"Arizona":{"68":"Apache County (AZ)","69":"Cochise County (AZ)"}

Notice that every element paris "Key":"value" inside a {} are separated by , bur there is no , after the last pair.

Use the page http://project-gc.com/Tools/MapCounties for correct county names used on pgc.
That map i likely good enough if tow counties are connected

It will take a time because there are 3142 counties in the US
Re: GC43JTD - Contiguous Counties 5 states
May 28, 2016 01:42AM
Target,

Thanks for your clarification of the graph. We realize this will take us a lot of time to compile the data. We are thinking of trying to create a sample graph for the New England states, so that you can create the script and we test it. At that time can I add a message to this subject and you respond to me, or would there be a better way.

Thanks,
MaxB on the River
Re: GC43JTD - Contiguous Counties 5 states
May 29, 2016 03:00AM
Here's JSON definition of all the counties, so you only have to work on the mappings:

https://www.dropbox.com/s/r9qxdnf5eyjy7c2/US%20counties%20JSON.txt?dl=0

I suspect Target's script design would be able to ignore any counties without connections defined, so you would be able to define connections for a subset to test. If not, you should be able to just remove the disconnected counties from this list when providing the subset of connections.
Re: GC43JTD - Contiguous Counties 5 states
May 29, 2016 03:35AM
sumbloke,

Thanks for the dropbox link, we have created for a couple of states, but this will help for completing the 48 states.
MaxB
Re: GC43JTD - Contiguous Counties 5 states
June 09, 2016 04:40PM
US County graph file for the checker has been completed and sent to Target. Awaiting his developing the script. Thanks for all your work.

MaxB on the River
Re: GC43JTD - Contiguous Counties 5 states
June 12, 2016 03:24PM
Working to resolve county graph data connections. Script does function correctly. Thanks to Target for all the help on completing this project.
Re: GC43JTD - Contiguous Counties 5 states
June 20, 2016 02:34AM
Checkers have been completed by Target on all of our Contiguous County (USA) challenges - 5, 10, 15, 20, 25, 30, 35 connected states. They work great and everyone is very impressed by the output.

Thank you Target for your fantastic work.
Re: GC43JTD - Contiguous Counties 5 states
June 20, 2016 02:55AM
Marking this thread "Resolved"
Sorry, only registered users may post in this forum.

Click here to login