31.05.2013 Views

think-cell technical report TC2003/01 A GUI-based Interaction ...

think-cell technical report TC2003/01 A GUI-based Interaction ...

think-cell technical report TC2003/01 A GUI-based Interaction ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.2 An Application of Dynamic Programming IMPLEMENTATION<br />

5.2.4 Advanced Gridline Matching Considerations<br />

In practice, there are a lot more issues involved with gridline matching than the<br />

basic matching discussed in the previous sections. For example, which exactly is<br />

the list of destination gridlines? Depending on the user input, some subset of the<br />

available gridlines from the destination slide must be chosen. The precise semantics<br />

of mouse input – typically a point or a rectangle – must be defined. In case of a<br />

single point, it is unclear where the input of destination gridlines stops. One possible<br />

implementation would take all available destination gridlines and treat the entire<br />

last row of the cost matrix as valid solutions. Figure 46 exemplifies the optimal<br />

solution in this case, where the minimum cost value from the last row of the matrix<br />

is taken as the starting point for the reconstruction.<br />

SOURCE<br />

DEST<br />

Dest.<br />

Source<br />

s 1 s 2 s 3 s 4 s 5<br />

d 1 d 2 d 3 d 4 d 5 d 6<br />

1<br />

2<br />

3<br />

4<br />

5<br />

Solution<br />

MergeGridlines(…)<br />

SOURCE<br />

DEST<br />

(a) Gridlines being matched<br />

1 2 3 4 5 6<br />

0<br />

SOURCE<br />

7<br />

SOURCE<br />

11<br />

SOURCE<br />

26<br />

SOURCE<br />

58<br />

DEST<br />

20<br />

SOURCE DEST IDENTIFY IDENTIFY DEST DEST<br />

96 131 81 97 105 139<br />

s 1 s 2 s 3 s 4 s 5<br />

d 1<br />

d 2<br />

Solution<br />

DEST DEST DEST DEST DEST<br />

23 77 165 317 428<br />

SOURCE IDENTIFY DEST DEST IDENTIFY DEST<br />

29 31 46 59 178 210<br />

DEST SOURCE DEST SOURCE IDENTIFY IDENTIFY<br />

18 35 41 61 74 199<br />

SOURCE DEST IDENTIFY SOURCE SOURCE DEST<br />

24 29 55 79 115 171<br />

SOURCE SOURCE DEST IDENTIFY DEST DEST<br />

70 89 133 83 109 147<br />

(b) Optimal path reconstruction<br />

Figure 46: Matching a dynamic number of destination gridlines<br />

IDENTIFY<br />

134<br />

Depending on the interpretation of the mouse pointer location as a reference<br />

point for the insertion, it might be necessary to run the optimization algorithm<br />

in two directions. In any case, gridlines must be matched for both dimensions,<br />

vertically and horizontally. This adds a new dimension to the complexity of the<br />

matching problem: The relationships between source and destination shapes that<br />

are established in one dimension may have an influence on the costs calculated for<br />

the other dimension. My approach to this interdependency is to iteratively try<br />

a small number of different solutions in either dimension and then decide for the<br />

ultimate best guess. This approach does not always yield the actual optimum, but<br />

it has the advantage to find a “good” solution in polynomial time.<br />

82

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!