Monketoo's picture
Add files using upload-large-folder tool
89d0916 verified

Finally, we compute the exact expression of $\mathbf{minE}(G, D) = f(s_0)$, when $s_0 \le s_{max}$:

f(s0)=s02(w0+W3(s0Dw0)2)=(W31/3+w0D)2(W3W32/3+w0)=(W31/3+w0)3D2,f(s_0) = s_0^2 \left( w_0 + \frac{W_3}{(s_0 D - w_0)^2} \right) = \left( \frac{W_3^{1/3} + w_0}{D} \right)^2 \left( \frac{W_3}{W_3^{2/3}} + w_0 \right) = \frac{\left( W_3^{1/3} + w_0 \right)^3}{D^2},

which concludes the proof. $\square$

Corollary 2 (equivalent tasks for speed) Consider a fork or join graph with tasks $T_i$, $0 \le i \le n$, and a deadline $D$, and assume that the speeds in the optimal solution to $\text{MINENERGY}(G, D)$ do not exceed $s_{max}$. Then, these speeds are the same as in the optimal solution for $n+1$ independent tasks $T'_0, T'_1, \dots, T'_n$, where $w'0 = (\sum{i=1}^n w_i^3)^{1/3} + w_0$, and, for $1 \le i \le n$, $w'i = w_0 \cdot \frac{w_i}{(\sum{i=1}^n w_i^3)^{1/3}}$.

Corollary 3 (equivalent task for energy) Consider a fork or join graph $G$ and a deadline $D$, and assume that the speeds in the optimal solution to $\text{MINENERGY}(G, D)$ do not exceed $s_{max}$. We say that the graph $G$ is equivalent to the graph $G^{(eq)}$, consisting of a single task $T_0^{(eq)}$ of weight $w_0^{(eq)} = (\sum_{i=1}^n w_i^{(eq)})^{1/3} + w_0$, because the minimum energy consumption of both graphs are identical: $\mathbf{minE}(G, D)=\mathbf{minE}(G^{(eq)}, D)$.

4.2.4. Trees

We extend the results on a fork graph for a tree $G = (V, E)$ with $|V| = n + 1$ tasks. Let $T_0$ be the root of the tree; it has $k$ children tasks, which are each themselves the root of a tree. A tree can therefore be seen as a fork graph, where the tasks of the fork are trees.

The previous results for fork graphs naturally lead to an algorithm that peels off branches of the tree, starting with the leaves, and replaces each fork subgraph in the tree, composed of a root $T_0$ and $k$ children, by one task (as in Corollary 3) that becomes the unique child of $T_0$'s parent in the tree. We say that this task is equivalent to the fork graph, since the optimal energy consumption will be the same. The computation of the equivalent cost of this task is done thanks to a call to the eq procedure, while the tree procedure computes the solution to $\text{MINENERGY}(G, D)$ (see Algorithm 1). Note that the algorithm computes the minimum energy for a tree, but it does not return the speeds at which each task must be executed. However, the algorithm returns the speed of the root task, and it is then straightforward to compute the speed of each children of the root task, and so on.

Theorem 2 (tree graphs) When $G$ is a tree rooted in $T_0$ ($T_0 \in V$, where $V$ is the set of tasks), the optimal solution to $\text{MINENERGY}(G, D)$ can be computed in polynomial time $O(|V|^2)$.

Proof. Let $G$ be a tree graph rooted in $T_0$. The optimal solution to $\text{MINENERGY}(G, D)$ is obtained with a call to tree $(G, T_0, D)$, and we prove its optimality recursively on the depth of the tree. Similarly to the case of the fork graphs, we reduce the tree to an equivalent task that, if executed alone within a deadline $D$, consumes exactly the same amount of energy. The procedure eq is the procedure that reduces a tree to its equivalent task (see Algorithm 1).