Example: marketing

5 Graph Theory - MIT OpenCourseWare

Mcs-ftl 2010/9/8 0:40 page 121 #1275 Graph TheoryInformally, a Graph is a bunch of dots and lines where the lines connect some pairsof dots. An example is shown in The dots are callednodes(orvertices)and the lines are example of a Graph with 9 nodes and 8 are ubiquitous in computer science because they provide a handy wayto represent a relationship between pairs of objects. The objects represent itemsof interest such as programs, people, cities, or web pages, and we place an edgebetween a pair of nodes if they are related in a certain way. For example, an edgebetween a pair of people might indicate that they like (or, in alternate scenarios,that they don t like) each other. An edge between a pair of courses might indicatethat one needs to be taken before the this chapter, we will focus our attention on simple graphs where the relation-ship denoted by an edge is symmetric.

5 Graph Theory Informally, a graph is a bunch of dots and lines where the lines connect some pairs of dots. An example is shown in Figure 5.1. The dots are called nodes (or vertices) and the lines are called edges. c h i j g e d f b Figure 5.1 An example of a …

Tags:

  Theory, Graph, Mit opencourseware, Opencourseware, Graph theory

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of 5 Graph Theory - MIT OpenCourseWare

1 Mcs-ftl 2010/9/8 0:40 page 121 #1275 Graph TheoryInformally, a Graph is a bunch of dots and lines where the lines connect some pairsof dots. An example is shown in The dots are callednodes(orvertices)and the lines are example of a Graph with 9 nodes and 8 are ubiquitous in computer science because they provide a handy wayto represent a relationship between pairs of objects. The objects represent itemsof interest such as programs, people, cities, or web pages, and we place an edgebetween a pair of nodes if they are related in a certain way. For example, an edgebetween a pair of people might indicate that they like (or, in alternate scenarios,that they don t like) each other. An edge between a pair of courses might indicatethat one needs to be taken before the this chapter, we will focus our attention on simple graphs where the relation-ship denoted by an edge is symmetric.

2 Afterward, in Chapter6, we consider thesituation where the edge denotes a one-way relationship, for example, where oneweb page points to the Simple GraphsDefinition graphGconsists of a nonempty setV, called thever-tices(akanodes2) ofG, and a setEof two-element subsets ofV. The membersofEare called theedgesofG, and we ;E/.1 Two Stanford students analyzed such a Graph to become multibillionaires. So, pay attention tograph Theory , and who knows what might happen!2We will use the terms vertex and node mcs-ftl 2010/9/8 0:40 page 122 #128 Chapter 5 Graph Theory122 The vertices correspond to the dots in , and the edges correspond to thelines. The Graph in expressed mathematically ;E/, where:VDfa;b;c;d;e;f;g;h;igEDffa;bg;fa;c g;fb;dg;fc;dg;fc;eg;fe;fg;fe;gg;fh;igg:N ote thatfa;bgandfb;agare different descriptions of the same edge, since setsare unordered. In this case, the ;E/has 9 nodes and 8 vertices in a simple Graph are said to beadjacentif theyare joined by an edge, and an edge is said to beincidentto the vertices it number of edges incident to a vertexvis called thedegreeof the vertex andis denoted by ; equivalently, the degree of a vertex is equals the number ofvertices adjacent to example, in the simple Graph shown in , vertexais adjacent tobandbis adjacent tod, and the edgefa;cgis incident to verticesaandc.

3 Vertexhhas degree 1,dhas degree 2, and It is possible for a vertex to havedegree 0, in which case it is not adjacent to any other vertices. A simple Graph doesnot need to have any edges at all in which case, the degree of every vertex is zeroandjEjD03 but it does need to have at least one vertex, that is,jVj that simple graphs donothave anyself-loops(that is, an edge of the formfa;ag) since an edge is defined to be a set oftwovertices. In addition, there is atmost one edge between any pair of vertices in a simple Graph . In other words, asimple Graph does not containmultiedgesormultiple edges. That is becauseEis aset. Lastly, and most importantly, simple graphs do not containdirected edges(thatis, edges of the ;b/instead offa;bg).There s no harm in relaxing these conditions, and some authors do, but we don tneed self-loops, multiple edges between the same two vertices, or graphs with novertices, and it s simpler not to have them around.

4 We will consider graphs with di-rected edges (calleddirected graphsordigraphs) at length in we llonly be considering simple graphs in this chapter, we ll just call them graphs from now Some Common GraphsSome graphs come up so frequently that they have names. Thecomplete graphonnvertices, denotedKn, has an edge between every two vertices, for a total 1/=2edges. For example,K5is shown in graphhas no edges at all. For example, the empty Graph with 5 nodesis shown in ,jEj, of the setEis the number of elements mcs-ftl 2010/9/8 0:40 page 123 # Definitions123 Figure complete Graph on 5 nodes, empty Graph with 5 Graph containingn 1edges in sequence is known as thelinegraphLn. More formally, ;E/whereVDfv1;v2;:::;vngandEDffv1;v2g;fv 2;v3g;:::;fvn 1;vnggFor example,L5is displayed in we add the edgefvn;v1gto the line graphLn, we get the graphCnconsistingof a simple cycle.

5 For example,C5is illustrated in 5-node line mcs-ftl 2010/9/8 0:40 page 124 #130 Chapter 5 Graph Theory124 Figure 5-node cycle (a)2314(b)Figure graphs that are isomorphic IsomorphismTwo graphs that look the same might actually be different in a formal sense. Forexample, the two graphs in Figure are both simple cycles with 4 vertices, but onegraph has vertex setfa;b;c;dgwhile the other has vertex setf1;2;3;4g. Strictlyspeaking, these graphs are different mathematical objects, but this is a frustratingdistinction since the graphslook the same!Fortunately, we can neatly capture the idea of looks the same through the no-tion of Graph ;E1 ;E2/are two graphs, then wesay thatG1isisomorphictoG2iff there exists abijection4fWV1!V2such thatfor every pair of verticesu;v2V1:fu; ; :The functionfis called other words, two graphs are isomorphic if they are the same up to a relabelingof their vertices.

6 For example, here is an isomorphism between vertices in the two4A bijectionfWV1!V2is a function that associates every node inV1with a unique node inV2and vice-versa. We will study bijections more deeply in mcs-ftl 2010/9/8 0:40 page 125 # Definitions125 Figure ways of shown in :acorresponds to1bcorresponds to2dcorresponds to4ccorresponds to3:You can check that there is an edge between two vertices in the Graph on the left ifand only if there is an edge between the two corresponding vertices in the Graph onthe isomorphic graphs may be drawn very differently. For example, we haveshown two different ways of drawingC5in preserves the connection properties of a Graph , abstracting out whatthe vertices are called, what they are made out of, or where they appear in a drawingof the Graph . More precisely, a property of a Graph is said to bepreserved underisomorphismif wheneverGhas that property, every Graph isomorphic toGalsohas that property.

7 For example, isomorphic graphs must have the same number ofvertices. What s more, iffis a Graph isomorphism that maps a vertex,v, of onegraph to the vertex, , of an isomorphic Graph , then by definition of isomor-phism, every vertex adjacent tovin the first Graph will be mapped byfto a vertexadjacent the isomorphic Graph . This means have thesame degree. So if one Graph has a vertex of degree 4 and another does not, thenthey can t be isomorphic. In fact, they can t be isomorphic if the number of degree4 vertices in each of the graphs is not the for preserved properties can make it easy to determine that two graphsare not isomorphic, or to actually find an isomorphism between them if there isone. In practice, it s frequently easy to decide whether two graphs are , no one has yet found ageneralprocedure for determining whether twographs are isomorphic that isguaranteedto run in polynomial such a procedure would be useful.

8 For example, it would make it easyto search for a particular molecule in a database given the molecular bonds. , in an amount of time that is upper-bounded byjVjcwherecis a fixed number mcs-ftl 2010/9/8 0:40 page 126 #132 Chapter 5 Graph Theory126the other hand, knowing there is no such efficient procedure would also be valu-able: secure protocols for encryption and remote authentication can be built on thehypothesis that Graph isomorphism is computationally SubgraphsDefinition ;E1/is said to be asubgraphof a ;E2/ifV1 V2andE1 example, the empty Graph onnnodes is a subgraph ofLn,Lnis a subgraphofCn, andCnis a subgraph ofKn. Also, the ;E/whereVDfg;h;igandEDffh;iggis a subgraph of the Graph in On the other hand, any Graph containing anedgefg;hgwould not be a subgraph of the Graph in the graphin not contain this that since a subgraph is itself a Graph , the endpoints of any edge in a sub- Graph must also be in the subgraph.

9 In other words ;E0/is a subgraphof some graphG, andfvi;vjg 2E0, then it must be the case Weighted GraphsSometimes, we will use edges to denote a connection between a pair of nodes wherethe connection has acapacityorweight. For example, we might be interested in thecapacity of an Internet fiber between a pair of computers, the resistance of a wirebetween a pair of terminals, the tension of a spring connecting a pair of devices ina dynamical system, the tension of a bond between a pair of atoms in a molecule,or the distance of a highway between a pair of such cases, it is useful to represent the system with anedge-weightedgraph(aka aweighted Graph ). A weighted Graph is the same as a simple Graph exceptthat we associate a real number (that is, the weight) with each edge in the speaking, a weighted Graph consists of a ;E/anda weight functionwWE!R. For example, a weighted graphwhere the weight of edgefa;bgis Adjacency MatricesThere are many ways to represent a Graph .

10 We have already seen two ways: youcan draw it, as in example, or you can represent it with sets as ;E/. Another common representation is with an adjacency mcs-ftl 2010/9/8 0:40 page 127 # Definitions1276 350dcbaFigure 4-node weighted Graph where the edgefa;bghas weight @0 1 0 11 0 1 00 1 0 11 0 1 01 CCA(a)0BB@0 5 0 05 0 6 00 6 0 30 0 3 01 CCA(b)Figure of adjacency matrices. (a) shows the adjacency matrix forthe Graph in (a) and (b) shows the adjacency matrix for the weightedgraph in In each case, we setv1Da,v2Db,v3Dc, andv4 Ddtoconstruct the ann-node ;E/whereVDfv1;v2;:::;vng,theadjacency matrixforGis then nmatrixAGDfaijgwhereaijD(1iffvi; a weighted Graph with edge weights given bywWE!R, then the adja-cency matrix forGisAGDfaijgwhereaijD( ;vjg/iffvi; example, the adjacency matrices for the graphs shown (a) ,v2Db,v3Dc, mcs-ftl 2010/9/8 0:40 page 128 #134 Chapter 5 Graph Matching ProblemsWe begin our study of Graph Theory by considering the scenario where the nodesin a Graph represent people and the edges represent a relationship between pairsof people such as likes , marries , and so on.))


Related search queries