interface(rtablesize=22): # Adjacency Matrices Lab 3, Graph Example Figure 1. M := < <0, 1, 0, 0, 0, 0> | <1, 0, 1, 0, 1, 0> | <0, 1, 0, 0, 0, 1> | <0, 0, 0, 0, 0, 0> | <0, 1, 0, 0, 0, 1> | <0, 0, 1, 0, 1, 1> >; # Adjacency Matrices Lab 3, Cape Air Figure 2. # 1=Boston, 2=Hyannis, 3=Martha's Vineyard, 4=Nantucket, # 5=New Bedford, 6=Providence, and 7=Provincetown B := < <0, 1, 1, 1, 0, 0, 1> | <1, 0, 1, 1, 0, 0, 0> | <1, 1, 0, 1, 1, 1, 0> | <1, 1, 1, 0, 1, 1, 0> | <0, 0, 1, 1, 0, 0, 0> | <0, 0, 1, 1, 0, 0, 0> | <1, 0, 0, 0, 0, 0, 0> >; # Adjacency Matrices Lab 3, Big Sky Airlines Figure 3. # Start with F=zero matrix. Create adjacency matrix C from F. # Enter into F connected cities that are greater alphabetically (bigger index). # When finished, then C equals F plus transpose F # The matrix F below may have mistakes. Please check it! F:=Matrix([ #1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Column index [0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1], # 01=Billings [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], # 02=Bismark [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], # 03=Boise [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 04=Denver [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 05=Glasgow [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0], # 06=Glendive [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], # 07=Great Falls [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 08=Havre [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], # 09=Helena [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0], # 10=Kalispell [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 11=Lewistown [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 12=Miles City [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 13=Missoula [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0], # 14=Moses Lake [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], # 15=Olympia [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 16=Seattle [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], # 17=Sidney [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 18=Spokane [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], # 19=Williston [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # 20=Wolf Point ]); C:=F+F^+; # Adjacency Matrices Lab 3, Spirit Airlines Figure 4. # 1=Atlantic City, 2=Chicago (O'Hare), 3=Detroit, # 4=Fort Lauderdale, 5=Fort Myers, 6=Los Angeles, # 7=Melbourne, 8=Myrtle Beach, 9=Newark, # 10=New York (LaGuardia), 11=Oakland, 12=Orlando, # 13=Tampa, and 14=Washington (Reagan National). A := < <0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0> | <1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0> | <0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0> | <1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1> | <1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0> | <0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | <0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1> | <1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0> | <0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0> | <0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0> | <0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | <1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0> | <1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | <0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0> >;