Skip to content

Instantly share code, notes, and snippets.

@rietta
Created November 19, 2012 18:17
Show Gist options
  • Save rietta/4112447 to your computer and use it in GitHub Desktop.
Save rietta/4112447 to your computer and use it in GitHub Desktop.
United States' State Adjacency Lists
# Author Gregg Lind
# License: Public Domain. I would love to hear about any projects you use if it for though!
# Original location: http://writeonly.wordpress.com/2009/03/20/adjacency-list-of-states-of-the-united-states-us/
AK
AL,MS,TN,GA,FL
AR,MO,TN,MS,LA,TX,OK
AZ,CA,NV,UT,CO,NM
CA,OR,NV,AZ
CO,WY,NE,KS,OK,NM,AZ,UT
CT,NY,MA,RI
DC,MD,VA
DE,MD,PA,NJ
FL,AL,GA
GA,FL,AL,TN,NC,SC
HI
IA,MN,WI,IL,MO,NE,SD
ID,MT,WY,UT,NV,OR,WA
IL,IN,KY,MO,IA,WI
IN,MI,OH,KY,IL
KS,NE,MO,OK,CO
KY,IN,OH,WV,VA,TN,MO,IL
LA,TX,AR,MS
MA,RI,CT,NY,NH,VT
MD,VA,WV,PA,DC,DE
ME,NH
MI,WI,IN,OH
MN,WI,IA,SD,ND
MO,IA,IL,KY,TN,AR,OK,KS,NE
MS,LA,AR,TN,AL
MT,ND,SD,WY,ID
NC,VA,TN,GA,SC
ND,MN,SD,MT
NE,SD,IA,MO,KS,CO,WY
NH,VT,ME,MA
NJ,DE,PA,NY
NM,AZ,UT,CO,OK,TX
NV,ID,UT,AZ,CA,OR
NY,NJ,PA,VT,MA,CT
OH,PA,WV,KY,IN,MI
OK,KS,MO,AR,TX,NM,CO
OR,CA,NV,ID,WA
PA,NY,NJ,DE,MD,WV,OH
RI,CT,MA
SC,GA,NC
SD,ND,MN,IA,NE,WY,MT
TN,KY,VA,NC,GA,AL,MS,AR,MO
TX,NM,OK,AR,LA
UT,ID,WY,CO,NM,AZ,NV
VA,NC,TN,KY,WV,MD,DC
VT,NY,NH,MA
WA,ID,OR
WI,MI,MN,IA,IL
WV,OH,PA,MD,VA,KY
WY,MT,SD,NE,CO,UT,ID
@nixpulvis
Copy link

// Data from: https://gist.github.com/rietta/4112447
//
// strict graphs don't have duplicate edges which allows this document to
// contain them for convenience.

strict graph {

    // Ordered by settlement date

    DE -- MD -- PA -- NJ
    PA -- NY -- NJ -- DE -- MD -- WV -- OH
    NJ -- DE -- PA -- NY
    GA -- FL -- AL -- TN -- NC -- SC
    CT -- NY -- MA -- RI
    MA -- RI -- CT -- NY -- NH -- VT
    MD -- VA -- WV -- PA -- DC -- DE
    SC -- GA -- NC
    NH -- VT -- ME -- MA
    VA -- NC -- TN -- KY -- WV -- MD -- DC
    NY -- NJ -- PA -- VT -- MA -- CT
    NC -- VA -- TN -- GA -- SC
    RI -- CT -- MA
    VT -- NY -- NH -- MA
    DC -- MD -- VA
    KY -- IN -- OH -- WV -- VA -- TN -- MO -- IL
    TN -- KY -- VA -- NC -- GA -- AL -- MS -- AR -- MO
    OH -- PA -- WV -- KY -- IN -- MI
    LA -- TX -- AR -- MS
    IN -- MI -- OH -- KY -- IL
    MS -- LA -- AR -- TN -- AL
    IL -- IN -- KY -- MO -- IA -- WI
    AL -- MS -- TN -- GA -- FL
    ME -- NH
    MO -- IA -- IL -- KY -- TN -- AR -- OK -- KS -- NE
    AR -- MO -- TN -- MS -- LA -- TX -- OK
    MI -- WI -- IN -- OH
    FL -- AL -- GA
    TX -- NM -- OK -- AR -- LA
    IA -- MN -- WI -- IL -- MO -- NE -- SD
    WI -- MI -- MN -- IA -- IL
    CA -- OR -- NV -- AZ
    MN -- WI -- IA -- SD -- ND
    OR -- CA -- NV -- ID -- WA
    KS -- NE -- MO -- OK -- CO
    WV -- OH -- PA -- MD -- VA -- KY
    NV -- ID -- UT -- AZ -- CA -- OR
    NE -- SD -- IA -- MO -- KS -- CO -- WY
    CO -- WY -- NE -- KS -- OK -- NM -- AZ -- UT
    ND -- MN -- SD -- MT
    SD -- ND -- MN -- IA -- NE -- WY -- MT
    MT -- ND -- SD -- WY -- ID
    WA -- ID -- OR
    ID -- MT -- WY -- UT -- NV -- OR -- WA
    WY -- MT -- SD -- NE -- CO -- UT -- ID
    UT -- ID -- WY -- CO -- NM -- AZ -- NV
    OK -- KS -- MO -- AR -- TX -- NM -- CO
    NM -- AZ -- UT -- CO -- OK -- TX
    AZ -- CA -- NV -- UT -- CO -- NM
    AK
    HI
}

US

dot USA.dot -Tsvg > USA.svg

Interesting note about the four corners, I'm surprised I haven't considered this before (or perhaps I just forgot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment