• No se han encontrado resultados

6. DISEÑO DE LAS PRÁCTICAS

6.1. Programación básica

The flow problem and the matching problem are two classical optimization problems in graph theory and are usually applied to design and analyze the other optimization problems. In this section, we investigate how to use the flow or matching algorithms to solve the GRID problem. More specifically, we consider the GRID problem with special input where jobs have unit height and unit width. We also introduce a special class of graphs, interval graphs. The special properties of interval graphs give us a way of tickling the GRID problem with more general input.

3.4.1 Flow problem

The minimum cost maximum flow problem with convex functions. Given a flow network, that is, a directed graph. There are source s and sink t, both are vertices. In the flow network, each edge has capacity, flow and cost. In the minimum cost maximum flow problem we want to find a path from s to t with the maximum flow but having the minimum cost [22, 80].

We can solve the unit-size scheduling problem by using the minimum cost maximum flow algorithm with convex functions. We can reduce the unit-size scheduling problem to the following min-cost max-flow problem. We have a graph G = (V, E), where V = {s, t} ∪ {J1, J2, ..., Jn} ∪ {t1, t2, ..., tτ}. For any two vertices Ji and tk, if time k

is feasible for job Ji, there is an edge from vertex Ji to vertex tk with capacity 1 and

constant cost c. For vertices Ji where 1 ≤ i ≤ n, there are edges (s, Ji) with capacity 1

and constant cost c. For vertices tk where 1 ≤ k ≤ τ , there are edges (tk, t) with

capacity n and cost is convex function of the flow on the edge.

There are already some work about convex cost function [74, 75]. Sokkalingam et al. [74] proposed an O(m(m + n log n) min{log(nU ), m log n})-time algorithm for convex cost function, where m is the number of edges, n is the number of vertices, and U is the maximum edge capacity. According to the reduction described above, it takes O(nτ (nτ + n log n) min{log n, nτ log n}) time to solve our scheduling problem.

3.4.2 Matching problem

The maximum-cardinality minimum-weight matching on a bipartite graph. Given a bipartite graph G = (U, V, E), where U and V are two parts of the graph and E is set of edges in G. For each edge (u, v) where u ∈ U and v ∈ V , there is a weight w(u, v). The maximum-cardinality minimum-weight matching problem on the graph G is finding the matching in G where have the maximum number of edges but the summation of the weights on these edges is minimum.

Given an instance of unit-size scheduling problem, we can reduce it to a maximum- cardinality minimum-weight matching instance as following. We have a bipartite graph G = (U, V, E). Part U = {J1, J2, ..., Jn} (each vertex Ji is corresponding to job Ji).

Part V has nτ vertices where V = {t11, t12, ..., t1n, t21, t22, ..., t2n, ..., tτ 1, tτ 2, ..., tτ n}. If

time T is feasible for job Ji, there is an edge (Ji, tT k) for all 1 ≤ k ≤ n. For each edge

that has one end point tij, its weight is f (j) − f (j − 1), where the function f is the

convex cost function in the scheduling problem. There are some algorithms for solving the weighted matching problem [34, 42]. However, the running time would be huge if we solve the scheduling problem by reducing it to a matching problem.

Example 3.4. Given jobs {J1, J2, J3, J4}. The feasible (not contiguous) timeslots of

J1, J2, J3, J4 are {1, 2}, {2, 4, 5}, {1, 3, 5}, and {2, 3, 5}, respectively. Figure 3.3 are

illustrations about the graph algorithms. Figure 3.3a shows the minimum cost maxi- mum flow problem transformed from the scheduling problem and Figure 3.3b shows the maximum-cardinality minimum-weight matching problem transformed from the schedul- ing problem. s t J1 J2 J3 J4 1 2 3 4 5 (capacity, cost) (1, c onstan t) (1, constant) (n, F(fl ow)) (a) J1 J2 J3 J4 11 12 1n 21 22 2n 31 32 3n 41 42 4n 51 52 5n (b) Figure 3.3: Illustration of Example 3.4.

3.4.3 Interval graphs

Interval graphs is a class of graphs which is widely discussed in scheduling problems. Definition 3.4. A graph G is an interval graph if it is the intersection graph of a collection of intervals on the real line. That is, there is an interval Ix for every vertex x

in G such that two vertices x and y are adjacent in G if and only if Ix∩ Iy 6= ∅.

Because of the nature of the scheduling problems, the interval graphs can capture some properties in the scheduling problems. For example, if each the tasks in a schedul- ing problems has to be served in a time interval, the interval graph of these intervals encodes the competition for resources between the jobs. That is, two tasks have conflicts if and only if there is an edge between the corresponding vertices in the interval graph. The class of interval graphs is a subset of the perfect graphs. There are many useful properties of interval graphs. Here we introduce a very important property of interval graphs:

Lemma 3.5 ([32]). An interval graph G has a consecutive clique arrangement, that is, there is a linear ordering [M1, M2, · · · , Mt] of the maximal cliques in G such that for

every vertex x, the maximal cliques that contain x form a subsequence.

We give an example of a interval graph corresponding to a set of intervals and illustrate its consecutive clique arrangement:

Example 3.5. Figure 3.4 is an example of a set of jobs, its corresponding interval graph and the corresponding maximal cliques. Figure 3.4a shows a set of jobs, where the horizontal line segments are the feasible intervals of jobs. The vertical dotted lines indicate the maximal cliques. Figure 3.4b shows an interval graph of the corresponding job set. And Figure 3.4c is a set of all the maximal cliques in the interval graph. The cliques are put in such a way that any vertex appears consecutively if there is two or more of it. a c d e f g h i j k b

(a) An input instance and the windows.

b d e g f h k i j c a

(b) The corresponding interval graph.

a b b c d b d e f g b e h b e i j b j k

(c) The consecutive cliques.

Figure 3.4: An input instance and the corresponding interval graph.

The consecutive clique arrangement property gives us a direction of dynamic pro- gramming. And hence many of the graph problems can be solved in polynomial time on interval graphs. For example, the maximum independent set problem, which is NP-hard for general graphs, is linear-time solvable for interval graphs [43]. By the consecutive clique arrangement property, we propose an exact algorithm for finding the optimal schedule of the GRID problem. The details are in Section 4.3.

Documento similar