Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mathematical Programming for Optimisation Mike Morgan and Vic Grout Centre for Applied Internet Research (CAIR) University of Wales NEWI Plas Coch Campus,

Similar presentations


Presentation on theme: "Mathematical Programming for Optimisation Mike Morgan and Vic Grout Centre for Applied Internet Research (CAIR) University of Wales NEWI Plas Coch Campus,"— Presentation transcript:

1 Mathematical Programming for Optimisation Mike Morgan and Vic Grout Centre for Applied Internet Research (CAIR) University of Wales NEWI Plas Coch Campus, Mold Road Wrexham, LL11 2AW, UK {mi.morgan|v.grout}@newi.ac.uk www.cair-uk.org NEWI North East Wales Institute of Higher Education - Centre for Applied Internet Research CAIR Seminar Programme, Wednesday 28 th May 2008

2 Mathematical Programming for Optimisation Optimisation generally involves maximising or minimising something The ‘ something ’ is the objective function e.g., “ Maximise x” or just max x (no solution) Also, there are usually constraints e.g., max x subject to (s.t.) x  2 (trivially x = 2 ) A better example, max3x + 2y s.t.3x - 2y  4 7y – 3x  9 Not so obvious!

3 A Better Example max3x + 2y s.t.3x - 2y  4 7y – 3x  9 Solution: x y 3x-2y = 4 7y-3x = 9 3x+2y

4 An Even Better Example x y Algorithms such as the Simplex Method find (as in ‘ home-in ’ on) the optimal solution This is Mathematical Programming

5 Common Notation Used to simplify/generalise large expressions in many dimensions/variables 3x + 4y – 2z + … = ax + by + cz + … = a 1 x 1 + a 2 x 2 + a 3 x 3 + … + a n x n

6 The General Form max/min Σ …x i s.t. Σ …  / = /  … Σ …  / = /  … … x i  {0,1} etc. Or, it can be expressed using linear algebra Vectors and matrices – can save space

7 Example: The ‘ Diet ’ Problem One of the first problems ever formulated in this way Consider buying the weekly shopping. Choice of n foods, containing m nutrients A = (a ij ) is the ‘amount’ matrix (2-d array ( m x n )) a ij is the quantity of the i th nutrient in the j th food r = (r i ) is the ‘requirement’ vector (1-d array ( m )) r i is the weekly requirement of nutrient i c = (c j ) is the ‘cost’ vector (1-d array ( n )) c j is the cost of food j x = (x j ) is the ‘consumption’ vector (1-d array ( n )) x j is the weekly consumption of food j

8 Example: The ‘ Diet ’ Problem We want to find a diet, of minimal cost, that satisfies the dietary requirement of all nutrients min c’x s.t.Ax  r x  0

9 Simple Network/Graph Problem Minimum Dominating Set (MDS) Find the minimum subset of nodes S, such that each node not in S has a neighbour in S

10 MDS as an Integer Program Vector s = (s i ), where s i = 1 if node i is a relay and 0 otherwise Adjacency matrix A = (a ij ), where a ij = 1 if there is an edge between nodes i and j and 0 otherwise.

11 A more complex problem Minimum connected dominating set (MCDS) Same as MDS only the subgraph induced by S must be connected Solve using surplus ‘ network flow ’ variables Increases complexity (runtime) for solving problem

12 Testing Connectivity with Network Flows (almost) Flow matrix F = (f ij ) records flow across edges Flows are directional To test connectivity, choose one node as source and all the others as sinks. The source introduces n- 1 units of flow onto the network and each sink must absorb 1. Flow may only be transmitted from a relay or from the source

13 Well, that ’ s lovely, but … … it doesn ’ t work! Consider using a different node as source: Need to restrict problem so that the source node can only send flow along one edge, unless it is a relay In other words, if the source is not a relay, it gives all it ’ s flow to a neighbouring relay

14 What does this look like as an integer program? First of all, set the source node as node 1 Node 1 must introduce n-1 units of flow onto the network: All other nodes must consume 1 unit:

15 What does this look like as an integer program? (cont ’ d) For all nodes other than the source, flows must originate from a relay and traverse a valid edge: Flow can originate from the source node if it isn ’ t a relay, but must travel along a valid edge to a neighbouring relay

16 What does this look like as an integer program? (cont ’ d) Binary ‘ source vector ’ q=(q i ), defined as q i =1 if flow is transmitted from the src node to i and 0 otherwise: If source is not a relay, q must sum to 1

17 How do we solve the problem? Solving a mathematical program with binary or integer variables is NP- complete Powerful method for finding optimal solutions Particularly if you use 3 rd party software! x y 3x+2y

18 Useful results Solving problems this way involves little software development Express your problem in this form and let the solver do the work Cplex solver originally developed by B. Bixby but now taken over by ILOG For MCDS (with a small alteration from model outlined) we ’ ve obtained optimal solutions for problems with n <= 100 nodes. Test accuracy of heuristics More complex variants of problem solved using combination of IP and heuristics

19 Subsets of Constraints Suppose we require 2 node- disjoint paths between all node pairs on the network. In this example, it is only necessary to constrain one node pair to get a feasible solution Number of flow variables is reduced from n 2 m to m Runtime of LP solver is exponentially related to number of variables!!

20 Subsets of constraints (cont ’ d) First require that every node have 2 relay neighbours minimise: subject to:

21 Subsets of constraints (cont ’ d) Introduce flow variables incrementally: Each constrained node pair (u,v) represents a commodity u creates 2 units of flow and v absorbs 2. All other nodes conserve flow. Transient nodes may only carry one unit of flow for a given commodity (ensures 2 disjoint paths)

22 Lower bounds and heuristics After each IP is solved, solution is checked for feasibility. If it is not feasible, the size of S represents a lower bound on the size of the optimal solution. Use heuristic after each IP, if it finds solution with size = lower bound, that solution is optimal. The more constraints are added, the more accurate the lower bound becomes Eventually, either the IP will yield a feasible solution or the heuristic will hit the lower bound

23 Good news and bad news Problems solved to optimality for n<=100 and up to four node-disjoint paths between all node pairs Unfortunately this does involve some software development

24 Any questions? Thank you NEWI North East Wales Institute of Higher Education - Centre for Applied Internet Research Mike Morgan and Vic Grout Centre for Applied Internet Research (CAIR) University of Wales NEWI Plas Coch Campus, Mold Road Wrexham, LL11 2AW, UK {mi.morgan|v.grout}@newi.ac.uk@newi.ac.uk www.cair-uk.org CAIR Seminar Programme, Wednesday 28 th May 2008


Download ppt "Mathematical Programming for Optimisation Mike Morgan and Vic Grout Centre for Applied Internet Research (CAIR) University of Wales NEWI Plas Coch Campus,"

Similar presentations


Ads by Google