Last Time: We cared about circuits. This means everything is

Last Time: We cared about circuits. This means everything is connected in our graph in a nice way. Our problems associated with these was about traveling the graph in a nice way like a postman or a salesman or some other thing. New Unit: Definition: Network: A connected graph. You may ask: “why’s this different than a connected graph?” And you’d be right. Network are just different based on the problems we do with them. Network problems are about having a message that needs to be passed out to everyone in the graph in a efficient way. Example: Electricity: Building a new town with new homes in different places, we need a grid that will reach every house without having extra power lines. We don’t need a circuit of electricity for this, and in fact any circuit would be inefficient. What’s the graph with the shortest amount of power lines? Genes: An ancestor will pass down his genes to a bunch of descendants. Obviously descendant genes can’t “converge” or come back to same species. If we have a collection of random species, what’s the “separation” and ordering of these? Social Networks: We can think every “friend” as an edge, and a “share” as a message passed starting from one person and expanding from “friend” to “friend”. So these problems usually care about “distance” from two points, which we define: Definition: Degree of Separation: The length of the shortest path connecting two vertices of a network. This is our distance for a network without weights. Weighted Network: A network with weights associated with edges. Again, we’ve already done weighted graphs. This is just a weighted connected graph. The most efficient way to build a graph that is connected for N vertices will only use N­1 edges, because that is the lowest we need to connect everything. This has a special name: Tree: A network with no circuits. Examples: Trees have a lot of properties. Theorem: N­1 Edges Property: A network with N vertices is a tree if and only if it is has exactly N­1 edges. All Bridges Property: Every edge in a tree is a bridge. Single Path Property: A tree has exactly one path between every pair of vertices. The last property tells us that we won’t be confused when asking for the degree of separation: there’s only one path to follow and you count the edges of that path. Example: Since a tree is perfectly efficient, we develop a measure of inefficiency for graphs: Definition: Redundancy ( R ) : N = # vertices, M = # edges, then Redundancy of a graph R equals R = M ­ (N­1). Since a tree has exactly M = N­1, the redundancy of tree is R = 0, the lowest redundancy possible for a network. Examples: Problems: 4, 7, 16, 22, 26, 30 Last Time: We talked about Networks. These are connected graphs where important messages of oil and internet are being passed between houses and points on the map. We introduced Trees as the most efficient network possible to send a message starting from one vertex and giving it to the rest. We listed all the wonderful properties of trees: No circuits, N­1 edges, all edges are bridges, One path b/w vertices. Problems: 4, 7, 16, ­> Friday’s Quiz 22, 26, 30 ­> Pushed back 3. 7. 15. Definitions: Subtree: A tree that is a subgraph of the network. Spanning Tree A subtree of the network that spans all the vertices. Example: Network: Subtree: Spanning Tree: Example: (Counting Spanning Trees) Cannot delete bridges. Example: Weighted network Without weights, obtaining a tree is the most efficient thing we can do. When we apply weights, we usually want to minimize the amount of time/money it takes to send something. For many problems: we are interested in the Minimum Spanning Tree: Definition: Minimum Spanning Tree (MST) : A spanning tree of a weighted network with the LOWEST weight. Maximum Spanning Tree (MaxST): A spanning tree of a weighted network with the HIGHEST weight. Without teasing you for a whole page like the book does: by changing the signs of weights you can change a MinST to MaxST or vice­versa. This means the algorithm to find both is exactly the same. MST Example: Dwarven Mountain Tunnel Network Problems: 21, 25, 29 Algorithm Kruskal’s Algorithm: For N vertices: 1) Pick the cheapest edge available. In case of tie, pick at random. 2) Remove edges that would complete a circuit. (Every new edge is a bridge in our tree). 3) Continue until you have N­1 edges. Problems: 33, 35, Last Time: 1. We talked about trees. 2. We talked about degree of sep., redundancy. 3. We found networks can have many spanning trees, these are just trees that touch all the vertices. 4. When we add weights (electrical resistance, water flow, internet), we suddenly are very interested in Minimal Spanning Trees. These are just spanning trees with the lowest weight. 5. We are now very interested in finding and counting all the minimal spanning trees. Every Time I mention trees I say they have no circuits. That we can define trees by being connected but having no circuits. Fact: Finding spanning tree == Removing Circuits. Example: To kill a circuit, take out an edge. Definition Simple Circuit: A circuit that doesn’t visit a vertex twice besides stop/start. (Like a Hamiltonian Circuit but not necessarily all the vertices like Ham) Theorem: Our redundancy (R) is the number of simple circuits in a Network. Counting Trees without just listing all the trees Case 1: No Shared Edges: 1) Look for all R simple circuits (triangle, quadrilateral, pentagon, etc.) 2) Count the number of edges 3) Multiply the number of edges in each circuit. # edges we can take out of the tree = (# edges in Circuit A) X (# edges in Circuit B) # Spanning Trees = #edges Circuit A* # edges Circuit B )* (# edges Circuit C).... Case 2: Shared Edge: We add two numbers: 1) The number of edges to choose after taking the shared circuit (two small circuits then make a big circuit) AND 2) The number of choices we have when we don’t pick a shared edge = ((#edges Circuit A) ­ # shared edges) * ((#edges Circuit A) ­ # shared edges) Remark: On your exam, # shared edges will just be = 1 like in the book to keep it simple. 1) Pick the shared edge. Only two circ Compute the same as above for when no one picks the shared edge, but with one less edge to choose from on each side. 2) Now include those times we someone chooses the shared edge. Then all the other edges from the other circuit can be chosen, and vice versa. #edges we can take out of a tree = # edges after taking out the shared edge Remark: I have a wonderful complicated example to show how I’m glossing over how complicated this gets. Consequently, the number of shared edges between circuits on the exam will be 1 or 2, and shared circuits will only come in pairs, not triplets or anything like in my example.