Docstoc

Recreational Math Games and Grap

Document Sample
Recreational Math Games and Grap Powered By Docstoc
					                                                      3         4
                                                                    32
                                                                      1 14
                                                          4 2
                                                                       1
                                                                     3 2

        and                                                                  2

Other Applications of
Graphs and Networks

Jo Ellis-Monaghan
St. Michaels College
Colchester, VT 05439
e-mail: jellis-monaghan@smcvt.edu
website: http://academics.smcvt.edu/jellis-monaghan
                Graphs and Networks
A Graph or Network is a set of vertices (dots) with edges (lines)
   connecting them.

                               A                              A
     A                                      B                         B
                  B

                                            A multiple edge



                  C        D                C
 D                                                        D           C

                                   A loop



Two vertices are adjacent if there is a line between them. The vertices A and
  B above are adjacent because the edge AB is between them. An edge is
  incident to each of the vertices which are its end points.

The degree of a vertex is the number of edges sticking out from it.
                            The Kevin Bacon Game
                                      or
                           6 Degrees of separation
                                                    Bacon      # of             Connery    # of
                                                    Number     People           Number     people
                                                        0           1              0           1
                                                        1         1766             1         2216
                                                        2       141840             2        204269
                                                        3       385670             3        330591
                                                        4        93598             4        32857
                                                        5         7304             5         2948
                                                        6         920              6          409
http://www.spub.ksu.edu/issues/v100/FA/n069/fea-        7         115              7          46
making-bacon-fuqua.html
                                                        8          61              8           8
                                                   Total number of linkable
Kevin Bacon is not even                            actors: 631275
                                                                                 Average Connery
                                                                                 Number: 2.706
among the top 1000 most                            Weighted total of linkable
                                                   actors: 1860181
connected actors in Hollywood                      Average Bacon number:        Data from The Oracle of
                                                                                Bacon at UVA
(1222th).                                          2.947
              The small world phenomenon

                                          Stanley Milgram sent a
                                          series of traceable letters
                                          from people in the
                                          Midwest to one of two
                                          destinations in Boston.
                                          The letters could be sent
                                          only to someone whom
                                          the current holder knew
                                          by first name. Milgram
                                          kept track of the letters
                                          and found a median
                                          chain length of about six,
                                          thus supporting the
                                          notion of "six degrees of
http://mathforum.org/mam/04/poster.html   separation."
Social Networks
•Stock Ownership (2001 NY
        Stock Exchange)
•Children‘s Social Network
•Social Network of Sexual
         Contacts




http://mathforum.org/mam/04/poster.html
Infrastructure and Robustness
             Scale Free




                       Number of vertices
                                                        Vertex degree
            JetBlue


              Distributed



                                   Number of vertices



                                                         Vertex degree
            MapQuest
Maximal Matchings in Bipartite Graphs

                     A Bipartite Graph



                                          Start with any matching

   Start at an
   unmatched
vertex on the left                           End at an unmatched
                                              vertex on the right

                                         Find an alternating path



          A maximal                         Switch matching to
          matching!                         nonmatching and vice
                                            versa
                             Conflict Scheduling




             A                                              A


  E                          B                  E                            B




      D                 C                            D                  C
Draw edges between classes       Color so that adjacent vertices have different colors.
with conflicting times           Minimum number of colors = minimum required
                                 classrooms.
                     Conflict Scheduling
Frequency Assignment                       Register Allocation
Assign frequencies to mobile radios and    Assign variables to hardware registers
other users of the electromagnetic         during program execution. Variables
spectrum. Two customers that are           conflict with each other if one is used both
sufficiently close must be assigned        before and after the other within a short
different frequencies, while those that    period of time (for instance, within a
are distant can share frequencies.         subroutine). Minimize the use of non-
Minimize the number of frequencies.        register memory.

 Vertices: users of mobile radios         Vertices: the different variables
 Edges: between users whose               Edges: between variables which conflict
        frequencies might interfere                 with each other
 Colors: assignments of different         Colors: assignment of registers
        frequencies

Need at least as many frequencies as the   Need at least as many registers as the
minimum number of colors required!         minimum number of colors required!
            Rectilinear pattern recognition
                         joint work with J. Cohn (IBM), R. Snapp and D. Nardi (UVM)
IBM‘s objective is to check a chip‘s design and find all occurrences of a
  simple pattern to:
    – Find possible error spots
    – Check for already patented segments
    – Locate particular devices for updating

                                                 The Haystack

                                                           The Needle…
                                   Pre-Processing
  BEGIN    /* GULP2A CALLED ON THU FEB 21 15:08:23 2002 */
  EQUIV 1 1000 MICRON +X,+Y
  MSGPER -1000000 -1000000 1000000 1000000 0 0
  HEADER GYMGL1 'OUTPUT 2002/02/21/14/47/12/cohn'
  LEVEL PC
  LEVEL RX
                                                               (Raw data format)
  CNAME ULTCB8AD

  CELL ULTCB8AD PRIME
    PGON N RX 1467923 780300 1468180 780300 1468180 780600 +
      1469020 780600 1469020 780300 1469181 780300 1469181 +
      781710 1469020 781710 1469020 781400 1468180 781400 +
      1468180 781710 1467923 781710
    PGON N PC 1468500 782100 1468300 782100 1468300 781700 +
      1468260 781700 1468260 780300 1468500 780300 1468500 +
      780500 1468380 780500 1468380 781500 1468500 781500
    RECT N PC 1467800 780345 1503 298
  ENDMSG



                                                               Two different layers/rectangles
                                                               are combined into one
                                                               layer that contains three shapes;
                                                               one rectangle (purple)
                                                               and two polygons (red and blue)


Algorithm is cutting edge, and not currently used for this application in industry.
      Linear time subgraph search for
                   target




Both target pattern and entire chip are encoded like this, with the vertices
also holding geometric information about the shape they represent. Then
we do a depth-first search for the target subgraph. The addition information
in the vertices reduces the search to linear time, while the entire chip
encoding is theoretically N2 in the number of faces, but practically NlogN.
   Netlist Layout
               How do we convert this…




… into this?
                                Netlist
A set S of vertices ( the pins) hundreds of thousands.
A partition P1 of the pins (the gates) 2 to 1000 pins per gate, average of
   about 3.5.
A partition P2 of the pins (the wires) again 2 to 1000 pins per wire,
   average of about 3.5.
A maximum permitted delay between pairs of pins.




                                                           Example



             Gate      Pin             Wire
The Wires
                                 The Wiring Space




  Placement layer-         Vias (vertical
  gates/pins go here       connectors)




Horizontal wiring      Vertical wiring
layer
                                             Up to 12 or so layers
                       layer
The general idea
          Place the pins so that pins are in
                their gates on the placement
                layer with non-overlapping
                gates.

          Place the wires in the wiring
               space so that the delay
               constrains on pairs of pins
               are met, where delay is
               proportional to minimum
               distance within the wiring,
               and via delay is negligible
                   Lots of ProbLems….
Identify Congestion
                                                   B    D   G
 Identify dense substructures from the netlist
 Develop a congestion ‗metric‘                    A    F

                                                   C    E   H
                     Congested area                              Congested
                                                                   area




    What often happens                      What would be good
Automate Wiring Small Configurations


                 Some are easy to place and route
                   Simple left to right logic
                   No / few loops (circuits)
                   Uniform, low fan-out
                   Statistical models work


                Some are very difficult
                   E.g. ‗Crossbar Switches‘
                   Many loops (circuits)
                   Non-uniform fan-out
                   Statistical models don‘t work
             Biomolecular constructions

                                                   Nano-Origami: Scientists At
                                                   Scripps Research Create
                                                   Single, Clonable Strand Of
                                                   DNA That Folds Into An
                                                   Octahedron
                                                   A group of scientists at The
                                                   Scripps Research Institute has
                                                   designed, constructed, and imaged
                                                   a single strand of DNA that
                                                   spontaneously folds into a highly
                                                   rigid, nanoscale octahedron that is
                                                   several million times smaller than
                                                   the length of a standard ruler and
                                                   about the size of several other
                                                   common biological structures, such
                                                   as a small virus or a cellular
                                                   ribosome.
http://www.sciencedaily.com/releases/2004/02/040
212082529.htm
             Assuring cohesion
A problem from biomolecular computing—physically constructing
       graphs by ‗zipping together‘ single strands of DNA




                                      (not allowed)
                                                      N. Jonoska, N.
                                                      Saito, ‘02
             DNA sequencing

                                   It is very hard in
                                   general to ―read
                                   off‘ the sequence of
                                   a long strand of
                                   DNA. Instead,
                                   researchers probe
          AGGCTC
  AGGCT                            for ―snippets‖ of a
                   GGCTC
                                   fixed length, and
                                   read those.
                           CTACT
 TCTAC
                                   The problem then
                                   becomes
                                   reconstructing the
                                   original long strand
                                   of DNA from the
CTCTA                      TTCTA
                                   set of snippets.
     Enumerating the reconstructions

This leads to a directed graph with the same number of in-arrows as out
arrows at each vertex.

The number of reconstructions is then equal to the number of paths
through the graph that traverse all the edges in the direction of their
arrows.
          Conquering the crazy cubes

The cubes from my puzzle are represented below.


         B                                        R

   G     W      R       G                  G      W   G       B

         W                                        B
                                                          2
                    1

         G                                        R

   R     W      R       B                 R       W   B       G

         R          3                             W       4
                          Build the Model

We will model each cube with a multigraph.
The vertices will correspond to the four colors and we connect the
corresponding vertices u and v if there is a pair of opposite faces colored u
and v.




         1                                        2




          3                                       4
                      Build the Model

Now construct a single multigraph with 4 vertices and the 12 edges,
labeling each edge by the cube associated with it.



                               3                 4
                                       R                          W
                                                     3
                                                         2
                                                             1
                                                                   1 4
  1               2                4       2

                                                             1
                                                         3
                                       B                         2 G


                                                                         2
  3               4
            Characterize a Solution

Suppose the puzzle has a
                                   3            4
solution. How would it be
represented on the final                            3
multigraph?                                             2
                                                            1
                                                                    1 4
                                       4   2

                                                            1
                                                        3
                                                                2


One subgraph will represent the front and back of the tower               2
and a second subgraph will represent the sides of the tower.

Using an edge in a subgraph corresponds to a positioning of the
cube (either front/back or sides).
     Characterize Front/Back and Left/Right
                   subgraphs


 What are the restrictions on the subgraphs and how do they
 relate to the solution?

1. Uses all four vertices.                        (all four colors)

2. Must contain four edges, one from each cube.   (orient each cube)

3. No edge can be used more than once.            (can‘t use same
                                                  orientation twice)

4.   Each vertex must be of degree 2.             (use that color twice,
                                                  one front & one back,
                                                  or one left & one right)
     Two Subgraphs satisfying the conditions

                                                                          4
 Here are two such subgraphs:                                 3
                                                                              3
                                                                                  21
                                                                      2                    14
                                                                  4
                                                                                      1
                                                                                  3    2

               2                            3                                                   2

     4                 1           2               4
               3                            1



          Front/Back                      Sides

Now, stack the cubes using these faces as the front/back and sides.
Since each edge represents an orientation, label the edges to determine the
orientation.
                  Build the solution stack

                                                                                     4
Now, stack the cubes using these faces as the front/back                 3
                                                                                         3
and sides.                                                                                   21
                                                                                 2                    14
                                                                             4
                                                                                                 1
                                                                                             3    2

              b        b                         r                                                         2
         f                 f                            3
                   2                         l               r   l
    4                      1             2                           4
         b         3 f     b                 r                   r
                                                             l
             f                                   l     1




             Front/Back                              Sides
        ? Is there another solution?
        ? Is it possible to find a set of subgraphs that use the loops ?
              All subgraphs with 4 edges and
                   4 vertices of degree 2
Only six types of subgraphs meet the solution requirements:




     ―square cycle‖           ―crossed cycle‖      ―loop and triangle‖




      ―four loops‖          ―two loops and a C2‖      ―two C2‘s‖
  “Same”
  Crossed Cycles




Loop and a Triangle
“Same” Arrangements
    Two double loops




      Three loops
So, look for these types of subgraphs




      ―square cycle‖                   ―crossed cycle‖              ―loop and triangle‖




       ―four loops‖                   ―two loops and a C2‖              ―two C2‘s‖

      Crazy Cubes/Instant Insanity slides modified from:
      Sarah Graham--http://academics.smcvt.edu/jellis-monaghan/combo2/special_topics_presentations.htm
      Judy Lalani-- http://math.hope.edu/lalani/ScienceDay.ppt

				
DOCUMENT INFO