Eulerian circuit(tour)
Premise: 4 nodes, 7 arcs Conclusion: to start from one node, pass through each arc exactly once and come back to the starting node, the degree (number of arcs sprouting from the node) of each node has to be e en! Conclusion: "e can only start from a node, pass through each arc exactly once and end up at a different node, if exactly # arcs ha e odd degree and the rest ha e e en degree!
Chinese Postman Problem
Premise: $o Eulerian tour, but %e %ish to take the shortest path from a start node to itself by co ering all the arcs (not once since the path is not Eulerian)! &he sum of all the degrees of all the nodes is e en because e ery arc adds # degrees(one per node it connects), so for n arcs, #n degrees! 'um of all odd degree nodes( degrees is e en, because the sum of e en ones( is e en and the total degree is e en, so e en ) e en * e en! &hen the number of odd degree nodes is e en because if it %ere odd, %e %ould ha e a odd number sum of odd numbers, %hich is odd!
+lgorithm for finding shortest path
,dentify all odd degree nodes (e en number of them) Consider all the pair%ise matchings of these nodes! "rite do%n the smallest distance bet%een the members of each pairing and sum up these distances -o this for all the pair%ise matchings
.or the matching that yields the shortest total distance, add the arcs of shortest path bet%een the members of the pairings! $o% count the total distance!
/raph to 0atrix
"e can form a matrix that represents the info in a graph by letting the columns rep! $odes, and ro%s rep! +rcs! &hen 123 4 4 35 4 23 4 3 matrix says that %e ha e 4 nodes, and # edges!
&he first edge lea es node 3 and goes to node 4! &he second edge lea es node 6 and goes to node 4 as %ell! ,mportant: ,f some of the edges form a loop, the ro%s that rep! those edges are linearly dependent! +lso note that e ery ro% ector only has # non 7eros, because the arc lea es exactly one node and goes into exactly one node! ,f the graph represents current flo%, then sol ing +x*4 tells us that if the potential is a ector in the nullspace, nothing %ill mo e! 'o if there is a nullspace %e fix the free ars! 8esponsible for it(ground the node)! +9(&)y * 4 is :irchoff(s Current ;a% (&otal flo% at a node is 4)! y2 ars! Correspond to arcs!
Euler(s .ormula
.or e ery graph, <nodes 2 <arcs = <loops * 3