11
1/25/05 Tucker, Sec.1.1 1 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 1

Applied Combinatorics, 4th Ed.Alan Tucker

Section 1.1

Graph Models

Prepared by Jo Ellis-Monaghan

Page 2: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 2

A Graph is a set of vertices (dots) with edges (lines) connecting them.

 E.g. #1:

 

 

 

 

 

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. The edge AB could also have been written as BA. 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.

A B

CD

deg(A) = 2deg(B) = 3deg(C) = 2deg (D) = 1

Page 3: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 3

A B

CD

A multiple edge

A loop

A B

CD

No loops or multiple edges are allowed in this book (other people allow them, sometimes calling them multigraphs or pseudographs). Eg. #2:       

 

A directed graph (a.k.a. an oriented graph, or a digraph) is a graph with little arrows on the edges. Eg. #3:  

Here the order of the letters when you write the edge is important. The directed (or oriented) edge from the vertex A to the vertex B is written . A is the tail of , and B is the head.

 

AB

AB

In-deg(A) = 0

Out-deg(A) = 2

Page 4: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 4

A path in a graph is just a list of vertices (none of them repeated) with an edge between each vertex in the list and the one after it.

Note: in some applications, repeated vertices are allowed, and sometimes the word trail is used to distinguish a path where repeated vertices are allowed, and walk where repeated edges are allowed.  A circuit (or cycle) is a path that goes back to the vertex it started at. Typically, a path or cycle in a digraph only traverses the edges in the directions of the arrows. However, there are antipaths and anticircuits where you traverse the edges in alternating directions. DBAC is a path in the graph below, and ABCA is a circuit. (Sometimes if it is clear from context that you are talking about a circuit, the last vertex isn’t repeated.) 

A B

CD

Page 5: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 5

A set of vertices in a graph which have no edges connecting any of them is called an independent set of vertices. An edge cover of a graph is a set of vertices in the graph so that every edge in the graph is incident with at least one of the vertices in the set.

 In a digraph, the analogy to an edge cover is called a vertex basis. Here the set of vertices is such that every edge in the graph has one of those vertices as its tail. To be a vertex basis though, the set of vertices must be as small as possible to cover the graph.

A B

CD

A B

CD

An independent set

An edge cover

A vertex basis

Page 6: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 6

Interval Graphs

• An interval graph is a special kind of graph which represents a bunch of overlapping (i.e. intersecting) intervals. If you have a bunch of overlapping intervals, you make a vertex for each interval, and put an edge between them if their intervals overlap.

Page 7: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 7

   

a

bc

de

Interval graph example

The intervals

The interval graph

Page 8: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 8

Not all graphs are interval graphs though.     

It is true in general that if a graph contains an n-cycle for n greater than 3, then it cannot be an interval graph.

Non-interval graph

??

1

2

a

b

c

Page 9: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 9

ExamplePut a cop on selected corners so that every

street is watched. Use as few cops as possible. Ie., find a minimal edge cover for this graph.

a

e

i

b c d

f

jg

h

k

Page 10: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 10

Note that to cover the subgraph formed by {a, b, e, f, i, j}, we need to use three vertices, either b, e, j, or a, f, i. If we use the former though, we get two extra edges, bc and ik, covered for free. So try this, and then look at the rest of the graph. The two remaining degree 3 vertices are c and h, so they would cover the most, so try them first. Hey…, yahoo, it works!

 

 Notice that the corners that don’t get cops form an independent set of vertices, i.e. there are no edges connecting any of them. This is always true: If one set of vertices is independent, all the rest of the vertices will form an edge cover and vice versa.

a

e

i

b c d

f

jg

h

k

There are 14 edges, and 6 vertices of degree 3 and 5 vertices of degree 2. A cop on a three way-corner can watch at most 3 streets, so to cover 14 edges we need at least 5 cops.

Solution

Page 11: 1/25/05Tucker, Sec.1.11 Applied Combinatorics, 4th Ed. Alan Tucker Section 1.1 Graph Models Prepared by Jo Ellis-Monaghan

1/25/05 Tucker, Sec.1.1 11

Do the rest of this example: find a way to position a minimal number of cops so that every corner is watched.

a

e

i

b c d

f

jg

h

k

Hint: Need at least three cops, since a degree 3 vertex can only watch 4 corners (itself and three other vertices), and there are 11 vertices to watch.

One solution is e, c, k.

For class to try