bretttolbert / mapgraph

Interactive SVG maps of the World, United States and US counties
6 stars 0 forks source link

BFS path jumps from county to a non-adjacent county #3

Open bretttolbert opened 12 years ago

bretttolbert commented 12 years ago
brett@brett-laptop:~/Projects/graphgame$ ./graphgame -m bfs-demo -n1 "Sheridan County, MT" -n2 "Lauderdale County, MS" -af preset us-counties -w
Using US Counties preset
Loading adjacency list file...
Starting breadth first search mode...
Performing BFS from Sheridan County, MT (30091) to Lauderdale County, MS (28075)...
Warning: No entry was found for "78030" although it was specified as a neighbor of "78020".
Done.
Optimal Path:
Sheridan County, MT (30091), Divide County, ND (38023), Burke County, ND (38013), Renville County, ND (38075), Bottineau County, ND (38009), Pierce County, ND (38069), Benson County, ND (38005), Nelson County, ND (38063), Grand Forks County, ND (38035), Marshall County, MN (27089), Beltrami County, MN (27007), Cass County, MN (27021), Aitkin County, MN (27001), Kanabec County, MN (27065), Chisago County, MN (27025), Washington County, MN (27163), Martin County, MN (27091), Kossuth County, IA (19109), Wright County, IA (19197), Bourbon County, KS (20011), Crawford County, KS (20037), Cherokee County, KS (20021), Newton County, MO (29145), Barry County, MO (29009), Carroll County, AR (5015), Boone County, AR (5009), Searcy County, AR (5129), Van Buren County, AR (5141), Faulkner County, AR (5045), Lonoke County, AR (5085), Arkansas County, AR (5001), Desha County, AR (5041), Chicot County, AR (5017), Issaquena County, MS (28055), Yazoo County, MS (28163), Attala County, MS (28007), Neshoba County, MS (28099), Lauderdale County, MS (28075), 
(38 moves)
brett@brett-laptop:~/Projects/graphgame$ 

Path jumps from Washington County, MN (27163) to Martin County, MN (27091) although they are not adjacent. Then it jumps from Wright County, IA (19197) to Bourbon County, KS (20011) although they are not adjacent.

bretttolbert commented 12 years ago
brett@brett-laptop:~/Projects/graphgame$ ./graphgame -m neighbors -n1 "Washington County, MN" -af preset us-counties
Using US Counties preset
Loading adjacency list file...
Neighbors of Washington County, MN (27163):
Anoka County, MN (27003)
Blue Earth County, MN (27013)
Brown County, MN (27015)
Chisago County, MN (27025)
Cottonwood County, MN (27033)
Dakota County, MN (27037)
Jackson County, MN (27063)
Martin County, MN (27091)
Ramsey County, MN (27123)
Watonwan County, MN (27165)
Pierce County, WI (55093)
Polk County, WI (55095)
St. Croix County, WI (55109)
brett@brett-laptop:~/Projects/graphgame$ 

US census adjacency file entry for Washington County, MN:

Washington County, MN   27163   Anoka County, MN    27003
        Chisago County, MN  27025
        Dakota County, MN   27037
        Ramsey County, MN   27123
        Washington County, MN   27163
        Pierce County, WI   55093
        Polk County, WI 55095
        St. Croix County, WI    55109
        Blue Earth County, MN   27013
        Brown County, MN    27015
        Cottonwood County, MN   27033
        Jackson County, MN  27063
        Martin County, MN   27091
        Watonwan County, MN 27165

Counties actually adjacent to Washington County, MN according to Wikipedia:

    Chisago County (north)
    Polk County, Wisconsin (northeast)
    St. Croix County, Wisconsin (east)
    Pierce County, Wisconsin (southeast)
    Dakota County (southwest)
    Ramsey County (west)
    Anoka County (northwest)
bretttolbert commented 12 years ago
brett@brett-laptop:~/Projects/graphgame$ ./graphgame -m neighbors -n1 "Wright County, IA" -af preset us-counties -w
Using US Counties preset
Loading adjacency list file...
Neighbors of Wright County, IA (19197):
Cerro Gordo County, IA (19033)
Franklin County, IA (19069)
Hamilton County, IA (19079)
Hancock County, IA (19081)
Hardin County, IA (19083)
Humboldt County, IA (19091)
Kossuth County, IA (19109)
Webster County, IA (19187)
Allen County, KS (20001)
Anderson County, KS (20003)
Bourbon County, KS (20011)
Coffey County, KS (20031)
Linn County, KS (20107)
Neosho County, KS (20133)
Wilson County, KS (20205)
Woodson County, KS (20207)
brett@brett-laptop:~/Projects/graphgame$ 

US census adjacency file entry for Wright County, IA:

Wright County, IA   19197   Cerro Gordo County, IA  19033
    Franklin County, IA 19069
    Hamilton County, IA 19079
    Hancock County, IA  19081
    Hardin County, IA   19083
    Humboldt County, IA 19091
    Kossuth County, IA  19109
    Webster County, IA  19187
    Wright County, IA   19197
    Allen County, KS    20001
    Anderson County, KS 20003
    Bourbon County, KS  20011
    Coffey County, KS   20031
    Linn County, KS 20107
    Neosho County, KS   20133
    Wilson County, KS   20205
    Woodson County, KS  20207

Counties actually adjacent to Wright County, IA according to Wikipedia:

Hancock County (north)
Franklin County (east)
Hamilton County (south)
Webster County (southwest)
Humboldt County (west)
bretttolbert commented 12 years ago

Now it's making an erroneous jump from Lipscomb County, TX (48295) to Bee County, TX (48025)

brett@brett-laptop:~/Projects/graphgame$ ./graphgame -m bfs-demo -n1 "Sheridan County, MT" -n2 "Lauderdale County, MS" -af preset us-counties -w
Using US Counties preset
Loading adjacency list file...
Starting breadth first search mode...
Performing BFS from Sheridan County, MT (30091) to Lauderdale County, MS (28075)...
Warning: No entry was found for "78030" although it was specified as a neighbor of "78020".
Done.
Optimal Path:
Sheridan County, MT (30091), Daniels County, MT (30019), Valley County, MT (30105), Garfield County, MT (30033), Custer County, MT (30017), Powder River County, MT (30075), Campbell County, WY (56005), Converse County, WY (56009), Albany County, WY (56001), Jackson County, CO (8057), Grand County, CO (8049), Clear Creek County, CO (8019), Park County, CO (8093), Fremont County, CO (8043), Pueblo County, CO (8101), Las Animas County, CO (8071), Baca County, CO (8009), Morton County, KS (20129), Texas County, OK (40139), Beaver County, OK (40007), Lipscomb County, TX (48295), Bee County, TX (48025), Refugio County, TX (48391), Calhoun County, TX (48057), Matagorda County, TX (48321), Brazoria County, TX (48039), Galveston County, TX (48167), Chambers County, TX (48071), Jefferson County, TX (48245), Cameron Parish, LA (22023), Jefferson Davis Parish, LA (22053), Evangeline Parish, LA (22039), Avoyelles Parish, LA (22009), Catahoula Parish, LA (22025), Tensas Parish, LA (22107), Warren County, MS (28149), Yazoo County, MS (28163), Attala County, MS (28007), Neshoba County, MS (28099), Lauderdale County, MS (28075), 
(40 moves)
brett@brett-laptop:~/Projects/graphgame$ 

US census adjacency file entry:

Lipscomb County, TX 48295   Beaver County, OK   40007
    Ellis County, OK    40045
    Hemphill County, TX 48211
    Lipscomb County, TX 48295
    Ochiltree County, TX    48357
    Roberts County, TX  48393
    Atascosa County, TX 48013
    Bee County, TX  48025
    Duval County, TX    48131
    Jim Wells County, TX    48249
    Karnes County, TX   48255
    Live Oak County, TX 48297
    McMullen County, TX 48311
    San Patricio County, TX 48409

Wikipedia Adjacent counties for Lipscomb, TX:

Beaver County, Oklahoma (north)
Ellis County, Oklahoma (east)
Hemphill County (south)
Roberts County (southwest)
Ochiltree County (west)
bretttolbert commented 12 years ago

I've corrected the entries for those three counties. The path from "Sheridan County, MT" to "Lauderdale County, MS" looks correct now, but I'm going to keep this issue open because I suspect there are other erroneous entries.