1 00:00:00,500 --> 00:00:01,600 PROFESSOR: OK. 2 00:00:01,600 --> 00:00:04,470 This video is a different direction. 3 00:00:04,470 --> 00:00:08,680 It will be about linear equations and not differential 4 00:00:08,680 --> 00:00:09,810 equations. 5 00:00:09,810 --> 00:00:13,040 A matrix is at the center of this video 6 00:00:13,040 --> 00:00:15,720 and it's called the incidence matrix. 7 00:00:15,720 --> 00:00:21,390 And that incidence matrix tells me everything about a graph. 8 00:00:21,390 --> 00:00:23,790 Now, what do I mean by the word graph? 9 00:00:23,790 --> 00:00:28,040 I don't mean a graph of sine x or cosine x. 10 00:00:28,040 --> 00:00:30,200 The word graph is used in another way 11 00:00:30,200 --> 00:00:35,300 completely for some edges and some nodes. 12 00:00:35,300 --> 00:00:36,420 So I have some nodes. 13 00:00:36,420 --> 00:00:39,131 In this case 1, 2, 3, 4 nodes. 14 00:00:41,960 --> 00:00:44,000 That's my number n. 15 00:00:44,000 --> 00:00:49,850 The number m is the number of edges that connect the nodes. 16 00:00:49,850 --> 00:00:56,140 So I have edge 1 connecting those nodes, edge 2, edge 3, 4, 17 00:00:56,140 --> 00:00:57,180 and 5. 18 00:00:57,180 --> 00:01:01,170 And I didn't put in an edge 6. 19 00:01:01,170 --> 00:01:04,660 A complete graph would have all possible edges, 20 00:01:04,660 --> 00:01:09,640 but a general graph can have some edges. 21 00:01:09,640 --> 00:01:11,680 Some pairs of nodes are connected 22 00:01:11,680 --> 00:01:14,730 others are not connected. 23 00:01:14,730 --> 00:01:20,520 So now I want to create the matrix that shows me everything 24 00:01:20,520 --> 00:01:22,180 that's in that picture. 25 00:01:22,180 --> 00:01:27,340 Then I can work with the matrix and graphs. 26 00:01:27,340 --> 00:01:32,950 And their matrices are the number one application, 27 00:01:32,950 --> 00:01:37,880 number one model for so many applications, 28 00:01:37,880 --> 00:01:40,470 like the world wide web. 29 00:01:40,470 --> 00:01:45,350 The web might have-- every website would be a node 30 00:01:45,350 --> 00:01:48,320 and there would be an edge between two nodes 31 00:01:48,320 --> 00:01:51,130 if those websites are linked. 32 00:01:51,130 --> 00:01:54,070 So the world wide web is a giant graph. 33 00:01:54,070 --> 00:01:59,270 Or the telephone company has a giant graph 34 00:01:59,270 --> 00:02:02,610 in which the nodes are the telephones, 35 00:02:02,610 --> 00:02:07,910 and there is an edge when a call is made from one phone 36 00:02:07,910 --> 00:02:10,690 to another, between two phones. 37 00:02:10,690 --> 00:02:13,550 So, nodes and edges. 38 00:02:13,550 --> 00:02:15,670 And our brain-- which is the great problem 39 00:02:15,670 --> 00:02:21,220 of the 21st century is to understand the graph that 40 00:02:21,220 --> 00:02:25,450 represents our brain, the connections of neurons 41 00:02:25,450 --> 00:02:30,690 in our thinking-- well, that's a tougher problem than we'll 42 00:02:30,690 --> 00:02:32,010 solve today. 43 00:02:32,010 --> 00:02:37,360 Let me work with that graph and create the matrix. 44 00:02:37,360 --> 00:02:42,990 So the matrix has five rows coming from the five edges. 45 00:02:42,990 --> 00:02:44,640 Let me take the first edge. 46 00:02:44,640 --> 00:02:49,340 So the first edge, there's edge number 1, goes from node 1 47 00:02:49,340 --> 00:02:51,210 to node 2. 48 00:02:51,210 --> 00:02:54,070 The nodes correspond to columns. 49 00:02:54,070 --> 00:02:58,820 So if I want an edge from node 1 to node 2, 50 00:02:58,820 --> 00:03:02,470 that edge 1 will go in row 1. 51 00:03:02,470 --> 00:03:05,910 So edge 1. 52 00:03:05,910 --> 00:03:09,520 First edge is connected to row 1. 53 00:03:12,210 --> 00:03:19,206 So that edge goes from node 1 to node 2, so I put a minus 1 54 00:03:19,206 --> 00:03:20,770 and a 1. 55 00:03:20,770 --> 00:03:24,810 And it doesn't touch nodes 3 and 4. 56 00:03:24,810 --> 00:03:26,070 That's edge 1. 57 00:03:26,070 --> 00:03:28,430 That's row 1. 58 00:03:28,430 --> 00:03:33,180 Now that tells me everything I see about edge 1. 59 00:03:33,180 --> 00:03:35,880 Edge 2 goes from 1 to 3. 60 00:03:35,880 --> 00:03:41,530 So I'll put a minus 1, a 0, and a 1 in row 2 61 00:03:41,530 --> 00:03:48,150 because row 2 comes from edge 2 and it goes from 1 to 3. 62 00:03:48,150 --> 00:03:53,370 Edge 3 will give me row 3, from 2 to 3. 63 00:03:53,370 --> 00:03:59,820 So edge 3 giving me row 3, 2 to 3. 64 00:03:59,820 --> 00:04:02,700 Edge 4 went from 1 to 4. 65 00:04:02,700 --> 00:04:06,860 So minus 1, nothing, nothing, 1. 66 00:04:06,860 --> 00:04:12,420 That tells me that edge 4 is going from node 1 to node 4. 67 00:04:12,420 --> 00:04:17,705 And finally, from node 2 to node 4 is the final row. 68 00:04:20,709 --> 00:04:23,500 Do you see there the graph? 69 00:04:23,500 --> 00:04:28,520 Everything, all the information in this picture 70 00:04:28,520 --> 00:04:31,440 is now captured in that matrix. 71 00:04:31,440 --> 00:04:33,790 So we can work with the matrix. 72 00:04:33,790 --> 00:04:35,850 And what does a matrix do? 73 00:04:35,850 --> 00:04:37,430 It multiplies vectors. 74 00:04:37,430 --> 00:04:40,320 That's what a matrix does, it acts on vectors. 75 00:04:40,320 --> 00:04:46,910 So what happens if I multiply that matrix by a vector? 76 00:04:46,910 --> 00:04:53,430 So now let me take out these edge numbers 77 00:04:53,430 --> 00:04:56,040 and do a multiplication. 78 00:04:56,040 --> 00:05:01,770 That matrix has four columns, it's a 5 by 4 matrix, m by n. 79 00:05:01,770 --> 00:05:04,040 5 by 4. 80 00:05:04,040 --> 00:05:10,590 So it multiplies a vector with four components and those four 81 00:05:10,590 --> 00:05:15,080 components will come from the four nodes. 82 00:05:15,080 --> 00:05:19,440 And maybe they represent voltages at the nodes. 83 00:05:19,440 --> 00:05:23,940 Let me think like an electrical engineer for a moment. 84 00:05:23,940 --> 00:05:27,140 So if there's my matrix, I imagine 85 00:05:27,140 --> 00:05:34,890 I have voltages, v1, v2, v3, v4, at the nodes. 86 00:05:34,890 --> 00:05:40,220 So there's a v1 voltage here, v2, a v3, and a v4, 87 00:05:40,220 --> 00:05:45,340 and where those voltages' currents will flow. 88 00:05:45,340 --> 00:05:49,400 So my unknowns are the voltages, the four voltages, 89 00:05:49,400 --> 00:05:50,950 and the five currents. 90 00:05:50,950 --> 00:05:55,130 That's what the engineer needs to know. 91 00:05:55,130 --> 00:06:01,280 So first of all, when I multiply A times v, what do I get? 92 00:06:01,280 --> 00:06:04,370 Let me just do that multiplication. 93 00:06:04,370 --> 00:06:12,270 So that first row times that gives me v2 minus v1, right? 94 00:06:12,270 --> 00:06:15,980 The dot product of the row with the vector. 95 00:06:15,980 --> 00:06:20,560 The next one is v3 minus v1. 96 00:06:20,560 --> 00:06:22,400 Then I have a minus 1 there. 97 00:06:22,400 --> 00:06:25,850 It's a v3 minus a v2. 98 00:06:25,850 --> 00:06:28,040 Then I have a minus 1 and a 1. 99 00:06:28,040 --> 00:06:31,830 I think that's v4 minus v1. 100 00:06:31,830 --> 00:06:34,800 And finally, this dot product of that 101 00:06:34,800 --> 00:06:39,450 will give me a v4 minus v2. 102 00:06:39,450 --> 00:06:41,830 So what am I seeing here? 103 00:06:41,830 --> 00:06:47,670 This is now A times v. I've done a multiplication 104 00:06:47,670 --> 00:06:50,930 by a vector of voltages. 105 00:06:50,930 --> 00:06:52,460 And what have I found? 106 00:06:52,460 --> 00:06:54,840 I found the differences in voltages, 107 00:06:54,840 --> 00:06:59,005 the voltage difference between one end 108 00:06:59,005 --> 00:07:02,270 of the edge and the other one. 109 00:07:02,270 --> 00:07:05,960 I have five edges and now I have five results 110 00:07:05,960 --> 00:07:07,680 and those are the voltage differences. 111 00:07:07,680 --> 00:07:10,020 And what does a difference in voltage 112 00:07:10,020 --> 00:07:15,670 do if these are at different voltages, different potentials? 113 00:07:15,670 --> 00:07:17,270 Current flows. 114 00:07:17,270 --> 00:07:21,120 If they're at the same potential, no current flows, 115 00:07:21,120 --> 00:07:22,242 right? 116 00:07:22,242 --> 00:07:25,840 That's the fundamental driving equation 117 00:07:25,840 --> 00:07:32,690 of currents from voltages is the difference in the voltage. 118 00:07:32,690 --> 00:07:35,830 The difference in the potential drives the flow. 119 00:07:35,830 --> 00:07:37,468 And now, how much flow? 120 00:07:41,260 --> 00:07:43,960 So now I'm looking for the flows. 121 00:07:43,960 --> 00:07:48,640 So can I call those w, for the flows. 122 00:07:48,640 --> 00:07:52,170 So I have a w2 is the flow on that edge. 123 00:07:52,170 --> 00:07:54,520 A w1 is a flow there. 124 00:07:54,520 --> 00:07:57,465 A w5, a w3, and a w4. 125 00:08:01,320 --> 00:08:05,360 My pair of unknowns-- and that's the beauty of this picture-- 126 00:08:05,360 --> 00:08:11,900 is the voltages v1 to v4 four at the nodes, and the currents, 127 00:08:11,900 --> 00:08:17,970 the flows, w1 to w5 on the five edges. 128 00:08:17,970 --> 00:08:23,560 And I've seen that Av gives me the voltage differences. 129 00:08:23,560 --> 00:08:29,930 I'm going to briefly, briefly approach 130 00:08:29,930 --> 00:08:34,370 the fundamental laws of flow, of current flow, 131 00:08:34,370 --> 00:08:37,640 of flow in any network. 132 00:08:37,640 --> 00:08:41,970 We're talking about the most basic equation, 133 00:08:41,970 --> 00:08:44,540 I would almost say, of applied mathematics. 134 00:08:44,540 --> 00:08:49,050 Maybe I should say of discrete applied mathematics. 135 00:08:49,050 --> 00:08:53,980 By discrete I mean a graph without derivatives. 136 00:08:53,980 --> 00:08:56,600 I'm not seeing derivatives here, I'm just 137 00:08:56,600 --> 00:08:58,470 seeing matrices and vectors. 138 00:09:05,100 --> 00:09:08,720 So I have to remember that incidence matrix, 139 00:09:08,720 --> 00:09:11,300 A-- let me write it down again. 140 00:09:11,300 --> 00:09:15,920 Av gave the voltage differences. 141 00:09:25,900 --> 00:09:30,670 And that's one part of my picture. 142 00:09:30,670 --> 00:09:36,100 Another part is what is the equation that finally brings it 143 00:09:36,100 --> 00:09:36,940 together? 144 00:09:36,940 --> 00:09:42,410 That if I have the currents-- so the v's were the voltages. 145 00:09:42,410 --> 00:09:45,000 Now, there's going to be an equation involving 146 00:09:45,000 --> 00:09:46,420 w, the currents. 147 00:09:50,980 --> 00:09:53,360 This, what I'm going to write here, 148 00:09:53,360 --> 00:09:55,840 is going to be really important. 149 00:09:55,840 --> 00:10:07,516 It's going to be Kirchhoff's Current Law, KCL. 150 00:10:10,850 --> 00:10:15,760 And I just emphasized that there are two Hs in Kirchhoff's name. 151 00:10:15,760 --> 00:10:18,570 So Kirchhoff's Current Law says-- 152 00:10:18,570 --> 00:10:28,220 and pay attention-- it says that the total flow into a node 153 00:10:28,220 --> 00:10:30,700 equals the flow out. 154 00:10:30,700 --> 00:10:33,760 We're talking about equilibrium here. 155 00:10:33,760 --> 00:10:39,620 So if current is traveling around my graph, my network, 156 00:10:39,620 --> 00:10:48,280 and it's a stable equilibrium here so that flow into node 1 157 00:10:48,280 --> 00:10:50,680 equals flow out of node 1. 158 00:10:50,680 --> 00:10:55,610 And let me tell you what that equation is 159 00:10:55,610 --> 00:10:58,290 in terms of the matrix A. 160 00:10:58,290 --> 00:11:01,560 This voltage difference is involved A 161 00:11:01,560 --> 00:11:06,290 and, beautifully, the Kirchhoff's Current Law 162 00:11:06,290 --> 00:11:08,410 involves A transpose. 163 00:11:08,410 --> 00:11:11,865 So A transpose now is 4 by 5. 164 00:11:14,770 --> 00:11:19,880 These are the flows, a vector with five components 165 00:11:19,880 --> 00:11:21,520 because I have five edges. 166 00:11:21,520 --> 00:11:27,410 And Kirchhoff's Current Law would say that's 0. 167 00:11:27,410 --> 00:11:34,310 So between A and A transpose, the incidence matrix 168 00:11:34,310 --> 00:11:39,870 is leading me to the fundamental equilibrium condition 169 00:11:39,870 --> 00:11:41,830 for flow in a network. 170 00:11:41,830 --> 00:11:47,180 Now, one more law is needed. 171 00:11:47,180 --> 00:11:51,520 It has to connect voltage differences to flows, 172 00:11:51,520 --> 00:11:55,210 potentials to currents. 173 00:11:55,210 --> 00:12:03,780 Do you know who created that law in electrical engineering? 174 00:12:03,780 --> 00:12:05,030 It was Ohm. 175 00:12:05,030 --> 00:12:17,640 So Ohm's Law, finally, Ohm's Law is edge by edge 176 00:12:17,640 --> 00:12:24,386 that the potential difference, the drop in potential, 177 00:12:24,386 --> 00:12:29,590 the potential forcing current is proportional to the current. 178 00:12:33,346 --> 00:12:38,270 So voltage difference-- let me write it in words. 179 00:12:38,270 --> 00:12:44,530 Voltage difference-- voltage drop 180 00:12:44,530 --> 00:12:56,670 I could say-- between the ends or across a resistor 181 00:12:56,670 --> 00:13:02,520 is proportional to, and there is some resistance, 182 00:13:02,520 --> 00:13:04,490 some physical number comes in here. 183 00:13:04,490 --> 00:13:10,150 This is where the material we're working with comes in. 184 00:13:10,150 --> 00:13:13,690 In Kirchhoff's Laws, those laws hold for a network 185 00:13:13,690 --> 00:13:16,810 before we even say what the network is made of. 186 00:13:16,810 --> 00:13:21,180 But now if our network is made of resistors or pipes 187 00:13:21,180 --> 00:13:26,697 or whatever we have, then this will be some conductance. 188 00:13:30,280 --> 00:13:43,100 So E equal IR, some resistance, times the flow, times 189 00:13:43,100 --> 00:13:53,260 the current flow, w. 190 00:13:53,260 --> 00:13:56,330 So a difference in v's is some number, 191 00:13:56,330 --> 00:13:58,730 this is the physical constant that we 192 00:13:58,730 --> 00:14:09,140 have to measure in a lab to know how many ohms our resistor is. 193 00:14:09,140 --> 00:14:11,910 That equation is on each edge. 194 00:14:11,910 --> 00:14:16,290 So we have a bunch of equations and together they 195 00:14:16,290 --> 00:14:22,910 tell us the four voltages and the five currents. 196 00:14:22,910 --> 00:14:28,700 And maybe I'll just make the main point here. 197 00:14:28,700 --> 00:14:32,930 The main point is that this matrix is crucial. 198 00:14:32,930 --> 00:14:34,160 A is crucial. 199 00:14:34,160 --> 00:14:36,180 A transpose is crucial. 200 00:14:36,180 --> 00:14:39,640 A gives voltage differences, it makes something happen. 201 00:14:39,640 --> 00:14:47,352 A transpose is the balance law, the balance or current balance 202 00:14:47,352 --> 00:14:48,641 at each node. 203 00:14:52,440 --> 00:14:56,210 And you won't be surprised that when the whole thing is 204 00:14:56,210 --> 00:15:01,370 put together and we have a final equation to solve, 205 00:15:01,370 --> 00:15:04,845 we end up with A transpose and A. 206 00:15:04,845 --> 00:15:08,660 And that magic combination, A transpose A, 207 00:15:08,660 --> 00:15:13,510 is central to graph theory. 208 00:15:13,510 --> 00:15:16,870 It's called the graph Laplacian and has 209 00:15:16,870 --> 00:15:19,950 a name and a fame of its own. 210 00:15:19,950 --> 00:15:21,820 Thank you.