OR 3: Chapter 17 - Routing Games Recap In the previous chapter: • We defined characteristic function games; • We defined the Shapley value. In this chapter we'll take a look at another type of game that allows us to model congestion. Routing games Game theory can be used to model congestion in a variety of settings: • Road traffic; • Data traffic; • Patient flow in healthcare; • Strategies in basketball. The type of game used is referred to as a routing game. Definition of a routing game A routing game (πΊ, π, π) is defined on a graph πΊ = (π, πΈ) with a defined set of sources π π and sinks π‘π . Each source-sink pair corresponds to a set of traffic (also called a commodity) ππ that must travel along the edges of πΊ from π π to π‘π . Every edge π of πΊ has associated to it a nonnegative, continuous and nondecreasing cost function (also called latency function) ππ . An example of such a game is given. A simple di-graph. In this game we have two commodoties with two sources: π 1 and π 2 and a single sink π‘. To complete our definition of a routing game we require a quantity of traffic, let π = (1/2,1/2). We also require a set of cost functions π. Let: ππ 1 π ππ 2 π ππ 1 π‘ ππ 2 π‘ πππ‘ =0 =0 = π₯2 π₯ = π₯ 2 =π₯ We represent all this diagrammatically. A routing game. Definition of the set of paths For any given (πΊ, π, π) we denote by π«π the set of paths available to commodity π. For our example we have: π«1 = {π 1 ππ‘, π 1 π‘} and π«2 = {π 2 ππ‘, π 2 π‘} We denote the set of all possible paths by π« = βπ π«π . Definition of a feasible path On a routing game we define a flow π as a vector representing the quantity of traffic along the various paths, π is a vector index by π«. Furthermore we call π feasible if: ∑ ππ = ππ π∈π«π In our running example π = (1/4,1/4,0,1/2) is a feasible flow. A feasible flow. To go further we need to try and measure how good a flow is. Optimal flow Definition of the cost function For any routing game (πΊ, π, π) we define a cost function πΆ(π): πΆ(π) = ∑ ππ (ππ )ππ π∈π« Where ππ denotes the cost function of a particular path π: ππ (π₯) = ∑π∈π ππ (π₯). Note that any flow π induces a flow on edges: ππ = ∑ ππ π∈π«if π∈π So we can re-write the cost function as: πΆ(π) = ∑ ππ (ππ )ππ π∈πΈ Thus for our running example if we take a general π = (πΌ, 1/2 − πΌ, 1/2 − π½, π½) as shown. A generic flow. The cost of π(πΌ, 1/2 − πΌ, 1/2 − π½, π½) is given by: πΆ(π) = πΌ 2 × πΌ + 3/2π½ × π½ + (1 − πΌ − π½) × (1 − πΌ − π½) = πΌ 3 + 3/2π½ 2 + πΌ 2 + 2πΌπ½ + π½ 2 − 2πΌ − 2π½ + 1 Definition of an optimal flow For a routing game (πΊ, π, π) we define the optimal flow π ∗ as the solution to the following optimisation problem: Minimise ∑π∈πΈ ππ (ππ ): Subject to: ∑ ππ = ππ for all π π∈π«π ππ = ∑ ππ for all π ∈ πΈ π∈π«if π∈π ππ ≥0 In our example this corresponds to minimising πΆ(πΌ, π½) = πΌ 3 + 3/2π½ 2 + πΌ 2 + 2πΌπ½ + π½ 2 − 2πΌ − 2π½ + 1 such that 0 ≤ πΌ ≤ 1/2 and 0 ≤ π½ ≤ 1/2. A plot of πΆ(πΌ, π½) is shown. πΆ(πΌ, π½). It looks like the minimal point is somewhere near higher values of πΌ and π½. Let us carry out our optimisation properly: If define the Lagrangian: πΏ(πΌ, π½, π1 , π2 , π3 , π4 ) = πΆ(πΌ, π½) − π1 πΌ − π2 (πΌ − 1/2) − π3 π½ − π4 π½ This will work but creates a large number of variables (so things will get messy quickly). Instead let us realise that the minima will either be in the interior of our region or on the boundary of our region. • If it is on the interior of the region then we will have: ππΆ = 3πΌ 2 − 2(1 − πΌ − π½) = 0 ππΌ and ππΆ = 3π½ − 2(1 − πΌ − π½) = 0 ππ½ which gives: π½= 2(1 − πΌ) 5 Substituting this in to the first equation gives: 6 3πΌ 2 − (1 − πΌ) = 0 5 which has solution (in our region): πΌ1 = √11 − 1 ≈ 0.4633 5 giving: π½1 = 0.2147 Firstly (πΌ1 , π½1 ) is located in the required region. Secondly it is straightforward to verify that this is a local minima (by checking the second derivatives). 3 2 1 3 We have πΆ(πΌ1 , π½1 ) = 125 (√11 − 6) + 125 (√11 − 1) ≈ .2723. To verify that this is an optimal flow we need to verify that it is less than all values on the boundaries. We first calculate the values on the extremal points of our boundary: 1. πΆ(0,0) = 1 2. πΆ(0,1/2) = 5/8 = .625 3. πΆ(1/2,0) = 3/8 = .375 4. πΆ(1/2,1/2) = 1/2 = .5 We now check that there are no local optima on the boundary: 1. Consider πΆ(πΌ, 0) = πΌ 3 + πΌ 2 − 2πΌ + 1 equating the derivative to 0 gives: 3πΌ 2 + 2πΌ − 2 = 0 which has solution πΌ = −1±√7 −1+√7 3 3 . We have πΆ( , 0) ≈ .3689. 2. Consider πΆ(πΌ, 1/2) = πΌ 3 + πΌ 2 − πΌ + 5/8 equating the derivative to 0 gives: 3πΌ 2 + 2πΌ − π + 5/8 = 0 which has solution πΌ = 1/3 and πΌ = 1. We have πΆ(1/3,1/2) ≈ .4398 3. When considering πΆ(0, π½) we know that the local optima is at π½ = 5. We have πΆ(0,2/5) = .6. 2 4. Similarly when considering πΆ(1/2, π½) we know that the local optima is at π½ = We have πΆ(1/2,3/10) = .3. 2−1/2 5 . Thus π ∗ ≈ (.4633,0.2147). Nash flows If we take a closer look at π ∗ in our example, we see that traffic from the first commodity travels across two paths: π1 = π 1 π‘ and π2 = π 1 ππ‘. The cost along the first path is given by: πΆπ1 (π ∗ ) =. 46332 ≈ .2146 The cost along the second path is given by: πΆπ2 (π ∗ ) = (1 − .4633 − .2147) ≈ .3220 Thus traffic going along the second path is experiencing a higher cost. If this flow represented commuters on their way to work in the morning users of the second path would deviate to use the first. This leads to the definition of a Nash flow. Definition of a Nash flow For a routing game (πΊ, π, π) a flow π~is called a Nash flow if and only if for every commodity π and any two paths π1 , π2 ∈ π«π such that ππ1 > 0 then: ππ1 (π) ≤ ππ2 (π) In other words a Nash flow ensures that all used paths have minimal costs. If we consider our example and assume that both commodities use all paths available to them: πΌ2 3π½ 2 2 = 1−πΌ−π½ = 1−πΌ−π½ 3 3 Solving this gives: π½ = 5 (1 − πΌ) ⇒ π₯ 2 + 5 π₯ − 5 this gives πΌ ≈ .5307 which is not in our region. Let us assume that πΌ = 1/2 (i.e. commodity 1 does not use π2 ). Assuming that the second commodity uses both available paths we have: 3 1 1 π½ = −π½ ⇒π½ = 2 2 5 We can check that all paths have minimal cost. Thus we have π~ = (1/2,1/5) which gives a cost of πΆ(π~) = 11/40 (higher than the optimal cost!). What if we had assumed that π½ = 1/2? This would have given πΌ 2 = 1/2 − πΌ which has solution πΌ ≈ .3660. The cost of the path π 2 ππ‘ is then . 134 however the cost of the path π 2 π‘ is . 75 thus the second commodity should deviate. We can carry out these same checks with all other possibilities to verify that π~ = (1/2,1/5).