23. human-computer...

29
23. Human-Computer Interaction In the internet—within http://www.hcibib.org/—the following definition is found: “Human-computer interaction is a discipline concerned with the design, evaluation and implementation of interactive computing systems for human use and with the study of major phenomena surrounding them .... Some of its special concerns are: the joint performance of tasks by humans and machines; the structure of communication between human and machine; human capabilities to use machines (including the learnability of interfaces); algorithms and programming of the interface itself; engineering concerns that arise in designing and building interfaces; the process of specification, design, and implementation of interfaces. . . . Human-computer interaction thus has science, engineering, and design aspects.” Many of these topics do only marginally concern algorithms in the classical sense. Therefore, in this chapter we concentrate on human-computer scenario for problem solving where the machines are forced to do lots of computation, and the humans have a role as intelligent controllers and directors. 23.1. Multiple-choice systems Humans are able to think, to feel, and to sense—and they adopt quickly to a new situation. We can also compute, but not too well. In contrast, computers are giants in computing—they crunch bits and bytes like maniacs. However, they cannot do anything else but computing—especially they are not very flexible. Combining the different gifts and strengths of humans and machines in appropriate ways may lead to impressive performances. One suitable approach for such team work is “Multiple-Choice Optimisation”. In a “Multiple-Choice System” the computer gives a clear handful of candidate so- lutions, two or three or five . . . Then a human expert makes the final choice amongst these alternatives. One key advantage of a proper multiple-choice approach is that the human is not drown by deluges of data.

Upload: others

Post on 11-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23. Human-Computer Interaction

In the internet—within http://www.hcibib.org/—the following definition is found:“Human-computer interaction is a discipline concerned with the design, evaluationand implementation of interactive computing systems for human use and with thestudy of major phenomena surrounding them . . . . Some of its special concerns are:

• the joint performance of tasks by humans and machines;

• the structure of communication between human and machine;

• human capabilities to use machines (including the learnability of interfaces);

• algorithms and programming of the interface itself;

• engineering concerns that arise in designing and building interfaces;

• the process of specification, design, and implementation of interfaces.

. . . Human-computer interaction thus has science, engineering, and design aspects.”Many of these topics do only marginally concern algorithms in the classical sense.

Therefore, in this chapter we concentrate on human-computer scenario for problemsolving where the machines are forced to do lots of computation, and the humanshave a role as intelligent controllers and directors.

23.1. Multiple-choice systems

Humans are able to think, to feel, and to sense—and they adopt quickly to a newsituation. We can also compute, but not too well. In contrast, computers are giantsin computing—they crunch bits and bytes like maniacs. However, they cannot doanything else but computing—especially they are not very flexible. Combining thedifferent gifts and strengths of humans and machines in appropriate ways may leadto impressive performances.

One suitable approach for such team work is “Multiple-Choice Optimisation”.In a “Multiple-Choice System” the computer gives a clear handful of candidate so-lutions, two or three or five . . . Then a human expert makes the final choice amongstthese alternatives. One key advantage of a proper multiple-choice approach is thatthe human is not drown by deluges of data.

Page 2: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1098 23. Human-Computer Interaction

Multiple-Choice Systems may be especially helpful in realtime scenarios of thefollowing type: In principle there is enough time to compute a perfect solution. Butcertain parameters of the problem are unknown or fuzzy. They concretise only ina very late moment, when there is no more time for elaborate computations. Nowassume that the decision maker has used multiple-choice algorithms to generate somegood candidate solutions in beforehand. When the exact problem data show up hemay select an appropriate one of these alternatives in realtime.

An example from vehicle routing is given. A truck driver has to go from A toZ. Before the trip he uses PC software to find two or three different good routesand prints them out. During the trip radio gives information on current traffic jamsor weather problems. In such moments the printed alternatives help the driver toswitch routes in realtime.

However, it is not at all easy to have the computer finding good small samplesof solutions. Naively, the most natural way seems to be the application of k-bestalgorithms: Given a (discrete) optimisation problem with some objective function,the k best solutions are computed for a prescribed integer k. However, such k-bestsolutions tend to be micro mutations of each other instead of true alternatives.

Figure 23.1 exhibits a typical pattern: In a grid graph of dimension 100×100 thegoal was to find short paths from the lower left to the upper right corner. The edgelengths are random numbers, not indicated in the diagram. The 1000 (!) shortestpaths were computed, and their union is shown in the figure. The similarity amongstall these paths is striking. Watching the picture from a somewhat larger distancewill even give the impression of only a single path, drawn with a bushy pencil. (Thecomputation of alternative short paths will also be the most prominent example casein Section 23.2)

Often the term´´multiple-choice” is used in the context of “multiple-choicetests”. This means something completely different. The difference between multiple-choice optimisation and multiple-choice tests lies in the type and quality of thecandidate solutions:

• In multiple-choice tests always at least one of the answers is "correct", whereasothers may be right or wrong. Beforehand an authority (the test designer) hasprepared the question together with the candidate answers and the decisionwhich of them are correct ones.

• In the optimisation situation nothing is clear: Perhaps all of the candidate so-lutions are ok, but it may also be that they all are not appropriate. And thereis typically no master who tells the human whether his choice is good or not.Because of this uncertainty many humans really need some initiation time toaccept their role within a multiple-choice system.

23.1.1. Examples of multiple-choice systems

(1) Short Paths

Starting in the early 1990’s, PC programs for vehicle routing have become more andmore popular. In 1997 the Dutch software company AND was first to sell such aprogram which did not only compute the “best” (= shortest or quickest) route but

Page 3: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.1. Multiple-choice systems 1099

Figure 23.1 1000 shortest paths in a 100 × 100 grid-graph, printed in overlap.

also one or two alternatives. The user had the choice to request all these candidatesolutions simultaneously or one after the other. The user was also allowed to deter-mine some parameters for route visualisation, namely different colours and thicknessfor best, second, third choice. Related is work by F. Berger. She developed a methodto identify linear structures (like roads, rails, rivers, . . . ) in grey level satellite im-ages. Typically, candidate structures are not unique, and the algorithm of Bergermakes several alternative proposals. The Berger method is based on algorithms forgenerating short alternative paths.

(2) Travelling Salesperson Problem and the Drilling of Holes in Circuit

Boards

In the Travelling Salesperson Problem (TSP) N locations are given and their mutualdistances. The task is to find a shortest round trip through all N points. TSP is NP-complete. One important application in electronic industry is the drilling of holesin circuit boards. Here the locations are the points where the drill has to make theholes; the goal is to minimise the time needed by the drill. In practice, however, itturns out that the length of the drilling tour is not the only criterion for success:Depending on the drilling tour there occur small or more severe tensions in the circuitboard. Especially different tours may give different levels of tension. Unfortunately,the degrees of tension can not easily be computed in beforehand. So it makes sense

Page 4: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1100 23. Human-Computer Interaction

to compute a few alternative short drilling tours and select that one which is bestwith respect to the minimisation of tension.

(3) Internet Search Engines

In most cases an internet search engine will find tons of hits, but of course a normalhuman user is not able nor willing to look through all of them. So, one of the keytasks for a search engine designer is to find good shortlisting mechanisms. As arule of thumb, the first ten hits in the output should be both most relevant andsufficiently spread. In this field and also in e-commerce Multiple-Choice Systems areoften called “Recommender Systems”.

(4) Trajectories for Interplanetary Space Missions

Space missions to distant planets, planetoids, and comets are high-tech adventures.Two key aspects are budget restrictions and the requirement that the probes needextremely high speeds to reach their destinations in time. “Gravity assist” maneuvershelp to speed up missiles by narrow flybys at intermediate planets, thus savingfuel and time. In recent years trajectories with gravity assists have become moreand more complex, typically involving whole sequences of several flybys. Prominentexamples are the mission Cassini to planet Saturn with flyby sequence Venus-Venus-Earth-Jupiter, the mission Rosetta to Comet “67P/Churyumov-Gerasimenko” withflyby sequence Earth-Mars-Earth-Earth, and the Messenger-mission to Mercury withflyby sequence Earth-Venus-Venus-Mercury-Mercury. The current art of trajectorycomputing allows to finetune a principal route. However, first of all such principalroutes have been designed by human engineers with their fantasy and creativity.Computer-generation of (alternative) principal flyby tours is still in its infancies.

(5) Chess with Computer Assistance

Commercial chess computers came up in the late 1970’s. Their playing strength in-creases steadily, and nowadays the best PC programs play on one level with thebest human players. However, teams with both human and computer members arestronger than humans alone or computers alone. One of these authors (Althöfer)made many chess experiments with Multiple-Choice Systems: In a setting called “3-Hirn” (“Triple Brain” in English, but the German term 3-Hirn has been adoptedinternationally) two different chess programs are running, typically on two indepen-dent PC’s. Each one proposes a single candidate move, and a human player has thefinal choice amongst these (at most) two move candidates. In several experiments3-Hirn showed amazing performance. The final data point was a match in 1997: twocomputer programs with Elo rating below 2550 each and a human amateur player(Elo 1900) beat the German No. 1 player (GM Yussupov, Elo 2640) by 5-3 in tourna-ment play, thus achieving an event performance of higher than Elo 2700. After thisevent top human professionals were no longer willing to fight against 3-Hirn teams.The strength of 3-Hirn is to a large extent explained by the combination of two “or-thogonal” chess strengths: chess computers propose only moves which are tacticallysound and the human player contributes his strength in long-range planning.

Today, all top human chess professionals prepare intensively for their tournamentgames with the help of chess programs by analysing openings and games in multiple-choice mode. Even more extreme is the situation in correspondence chess, whereplayers are officially allowed to use computer help within their games.

Page 5: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1101

(6) Travel and Holiday Information

When someone plans a journey or a holiday, he typically compares different routes oroffers, either at the railway station or in a travel agency or from home via internet.Customers typically do not inspect thousands of offers, but only a smaller or largerhandful. In real life lots of (normal and strange) strategies can be found how com-panies, hotels, or airlines try to place their products amongst the top choices. Forinstance, it is common (bad) policy by many airlines to announce unrealistic shortflight times. The only intention is to become top-placed in software (for travel agen-cies) which sorts all flights from A to B by ascending flight times. In many cases it isnot an easy task for the customer to realize such tricks for successful “performance”in shortlisting processes.

(7) RNA-Foldings

Computation of RNA-foldings is one of the central topics in computational biology.The most prominent algorithms for this are based on dynamic programming. Thereexist online repositories, where people get alternative solutions in realtime.

Exercises23.1-1 Collect practice in operating a multiple-choice system by computer-aidedplay of the patience game FreeCell. Download the tool BigBlackCell (BBC) fromhttp://www.minet.uni-jena.de/∼BigBlackCell/ and make yourself acquainted withthe program. After some practising a normal user with the help of BBC should beable to solve in the average more than 60 FreeCell instances per hour.

23.2. Generating multiple candidate solutions

23.2.1. Generating candidate solutions with heuristics

Many optimisation problems are really hard, for instance the NP-complete ones.Exact (but slow) branch and bound procedures and unreliable (but quick) heuristicsare two standard ways to find exact or approximate solutions. When the task is togenerate several alternative solutions it is possible to make a virtue of necessity: thereare normally many more good solutions than perfect ones – and different heuristicsor heuristics with random elements will not always return the same good solution.

So, a simple strategy is to apply one or several heuristics repeatedly to the sameproblem, and to record the solutions generated during this process. Either, exactlyas many solutions as needed are generated. Or a larger preliminary set of solutionsis produced, giving the chance for improvement by shortlisting. Natural shortlistingcriteria are quality and spread. Concerning spread, distance measures on the set ofadmissible solutions may be a helpful tool in conjunction with clustering algorithms.

Repeated runs of a single heuristic. The normal situation is that a heuristiccontains randomness to a certain extent. Then no additional efforts are necessary:the heuristic is simply executed in independent runs, until enough different good so-lutions have been generated. Here we use the Travelling Salesperson Problem (TSP)for N points as an example to demonstrate the approaches. For exchange heuris-

Page 6: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1102 23. Human-Computer Interaction

tics and insertion heuristics on the TSP we give one example each, highlighting theprobabilistic elements.

In the TSP with symmetric distances d(i, j) between the points local searchwith 2-exchanges is a standard exchange heuristic. In the following pseudo-codeT (p) denote the p-th component of vector T .

Local-Search-with-2-Exchanges-for-TSP(N, d)

1 Generate a random starting tour T = (i1, i2, . . . , iN ).2 while there exist indices p, q with 1 ≤ p < q ≤ N and q ≥ p + 2, and

d(T (p), T (p + 1)) + d(T (q), T (q + 1)) >

d(T (p), T (q)) + d(T (p + 1), T (q + 1))� For the special case q = N we take q + 1 = 1.

3 do T ← (i1, . . . , ip, iq, iq−1, . . . , ip+1, iq+1, . . . , iN )4 compute the length l of tour T

5 return T, l

Random elements in this heuristic are the starting tour and the order in whichedge pairs are checked in step 2. Different settings will lead to different local minima.In large problems, for instance with 1,000 random points in the unit square withEuclidean distance it is quite normal when 100 independent runs of the 2-exchangeheuristic lead to almost 100 different local minima.

The next pseudo-code describes a standard insertion heuristic.

Insertion-Heuristic-for-TSP(N, d)

1 generate a random permutation (i1, i2, . . . , iN ) from the elements of {1, 2, . . . , N}2 T ← (i1, i2)3 for t← 2 to N − 14 do find the minimum of d(T (r), it+1) + d(it+1, T (r + 1))− d(T (r), T (r + 1))

for r ∈ {1, . . . , t}� Here again r + 1 = 1 for r = t.

let the minimum be at r = s

5 T ← (T (1), . . . , T (s), it+1, T (s + 1), . . . , T (t))6 compute the length l of tour T

7 return T, l

So the elements are inserted one by one, always at the place where insertionresults at minimal new length.

The random element is the permutation of the N points. Like for the 2-exchanges,different settings will typically lead to different local minima. Sometimes an addi-tional chance for random choice occurs when for some step t the optimal insertionplace is not unique.

Many modern heuristics are based on analogies to nature. In such cases the userhas even more choices: In Simulated Annealing several (good) intermediate solutionsfrom each single run may be taken; or from each single run of a Genetic Algorithmseveral solutions may be taken, either representing different generations or multiple

Page 7: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1103

solutions of some selected generation.A special technique for repeated exchange heuristics is based on the perturbation

of local optima: First make a run to find a local optimum. Then randomise this firstoptimum by a sequence of random local changes. From the resulting solution startlocal search anew to find a second local optimum. Randomise this again and so on.The degree of randomisation steers how different the local optima in the sequencewill become.

Even in case of a deterministic heuristic there may be chances to collect morethan only one candidate solution: In tiebreak situations different choices may leadto different outcomes, or the heuristic may be executed with different precisions(=number of decimals) or with different rounding rules. In Subsection 23.2.4 penaltymethods are described, with artificial modification of problem parameters (for in-stance increased edge lengths) in repeated runs. In anytime algorithms —like iter-ative deepening in game tree search—also intermediate solutions (for preliminarysearch depths) may be used as alternative candidates.

Collecting candidate solutions from different heuristic programs. Whenseveral heuristics for the same problem are available, each one of them may con-tribute one or several candidate solutions. The 3-Hirn setting, as described in item(5) of Subsection 23.1.1, is an extreme example of a multiple-choice system withmore than one computer program: the two programs should be independent of eachother, and they are running on distinct computers. (Tournament chess is played un-der strict time limits at a rate of three minutes per move. Wasting computationalresources by having two programs run on a single machine in multi-tasking modecosts 60 to 80 rating points [9]). The chess programs used in 3-Hirn are standardof-the-shelf products, not specifically designed for use in a multiple-choice setting.

Every real world software has errors. Multiple-choice systems with independentprograms have a clear advantage with respect to catastrophic failures. When twoindependent programs are run, each with the same probability p for catastrophicerrors, then the probability for a simultaneous failure reduces to p2. A human con-troller in a multiple-choice system will typically recognise when candidate solutionshave catastrophic failures. So the “mixed” case (one normal and one catastrophicsolution) with probability 2p(1− p) will not result in a catastrophe. Another advan-tage is that the programs do not need to have special k-best or k-choice mechanisms.Coinciding computer proposals may be taken as an indication that this solution isjust really good.

However, multiple-choice systems with independent programs may also haveweak spots:

• When the programs are of clearly different strength, this may bring the humanselector in moral conflicts when he prefers a solution from the less qualifiedprogram.

• In multistep actions the proposals of different programs may be incompatible.

• For a human it costs extra time and mental energy to operate more than oneprogram simultaneously.

• Not seldom – depending on programs and operating systems – a PC will run

Page 8: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1104 23. Human-Computer Interaction

unstably in multi-tasking mode.

And of course it is not always guaranteed that the programs are really independent.For instance, in the late 1990’s dozens of vehicle routing programs were available inGermany, all with different names and interfaces. However, they all were based ononly four independent program kernels and data bases.

23.2.2. Penalty method with exact algorithms

A more controlled way to find different candidate solutions is given by the penalty

method. The main idea of this method is illustrated on the route planning example.Starting with an optimal (or good) route R1 we are looking for an alternative solutionR2 which fulfills the following two criteria as much as possible.

(i) R2 should be good with respect to the objective function. Otherwise it is notworthwhile to choose it. In our example we have the length (or needed time) of theroute as first objective.

(ii) R2 should have not too much in common with the original solution. Otherwiseit is not a true alternative. In case of so called micro mutations the risk is high thatall these similar candidates have the same weak spots. In our example a "measurefor similarity" may be the length of the parts shared by R1 and R2.

This means R2 should have a short length but it should also have only little incommon with R1. Therefore we use a combination of the two objective functions –the length of the route and the length of the road sections shared by R1 and R2.This can be done by punishing the sections used by R1 and solving the shortest pathproblem with this modified lengths to get the solution R2.

By the size of the penalties different weightings of criteria (i) and (ii) can bemodelled.

A most natural approach is to use relative penalty factors. This means thatthe length of each section belonging to R1 is multiplied by a factor 1 + ε.

Penalty-Method-with-Relative-Penalty-Factors(G, s, t, ε)

1 find the shortest path R1 from node s to node t in the weighted graphG = (V, E, w)

2 for all e ∈ E

3 do if e belongs to R1

4 then w(e)← w(e) · (1 + ε)5 else w(e)← w(e)6 find the the shortest path R2 from node s to node t

in the modified graphG = (V, E, w)7 compute its unmodified length w(R2)8 return (R1, R2) and (w(R1), w(R2))

Consider the following example.

Page 9: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1105

9

8.7

8

1

1.1

2

1

14

9

9

8

S

A B

C

D

E

F

G H

T

Figure 23.2 The graph for Examples 23.1, 23.2 and 23.6.

Example 23.1 Given is a graph G = (V, E) with weighted edge lengths. In Figure 23.2the numbers denote the length of the according edges. The shortest path from S to T isPD via S - A - C - D - F - T with length 23. Multiplying all edge lengths of PD by 1.1 andsolving the obtained shortest path problem gives the alternative solution PB via S - A - B

- F - T with modified length 25.0 and normal length 23.7. The shared parts of PD and PB

are S-A and F -T with total length 13.

The size of ε has to be appropriate for the situation. In the commercial vehiclerouting program [?] all sections of a shortest (or fastest) route were multiplied by 1.2,i.e., ε = 0.2. Then the alternative route was computed. In [?] recognition of linearstructures (streets, rivers, airport lanes) in satellite images was done by shortest pathmethods. Here ε = 1.0 turned out to be an appropriate choice for getting interestingalternative candidates.

Instead of relative penalty factors additive penalties might be used. Thatmeans we add a constant term ε to all edges we want to punish. The only modificationof the algorithm above is in step 4.

4∗ then w(e)← w(e) + ε

Example 23.2 Given is the graph G = (V, E) from Example 23.1 (see Figure 23.2). Theshortest path from S to T is still PD via S - A - C - D - F - T with length 23. Adding0.1 to all edges of PD and solving the resulting shortest path problem gives the alternativesolution PE via S - A - C - E - F - T with modified length 23.4 and normal length 23.1.PD and PE have three edges in common.

In principle this approach with additive penalties is not worse in comparison withmultiplicative penalties. However, the method with multiplicative penalties has theadvantage to be immune against artificial splits of edges.

For a generalisation of the penalty method from routing problems the followingdefinition of optimisation problems is helpful.

Page 10: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1106 23. Human-Computer Interaction

Definition 23.1 Let E be an arbitrary finite set and S a set of subsets of E. E iscalled the base set and the elements of S are feasible subsets of E. Let w : E → R

be a real valued weight function on E. For every B ∈ S we set w(B) =∑

e∈B

w(e).

The optimisation problem minB∈S

w(B) is a Sum Type Optimisation Problem

or in short "∑

-type problem" .

Remarks:

1. The elements B ∈ S are also called feasible solutions.

2. By substitution of w by −w every maximisation problem can be formulatedas a minimisation problem. Therefore we will also call maximisation problems∑

-type problems.

Examples of∑

-type problems

• Shortest Path Problem

• Assignment Problem

• Travelling Salesperson Problem (TSP)

• Knapsack Problem

• Sequence Alignment Problem

Example 23.3 Consider the Knapsack Problem. Given a set of items I = {I1, I2, . . . , In},a weight function w : I → R

+, a value function v : I → R+, and a knapsack capacity

C. What is the most valuable collection of items whose weight sum does not exceed theknapsack capacity?

Choosing I as base set and S as the family of all subsets whose weight sum is smalleror equal to C gives a representation as a

∑-type problem: maximise v(B) over all B ∈ S.

Abstract formulation of the penalty method for∑

-type problems

Definition 23.2 Let E be an arbitrary set and S the set of feasible subsets of E.Let w : E → R be a real-valued and p : E → R

≥0 a non-negative real-valued functionon E.

For every ε > 0, let Bε be one of the optimal solutions of the problem

minB∈S

fε(B) ,

with fε(B) := w(B) + ε · p(B) .

With an algorithm which is able to solve the unpunished problem minB∈S

w(B) we can

also find the solutions Bε. We just have to modify the function w by replacingw(e) by w(e) + ε · p(e) for all e ∈ E. Bε is called an ε−ε−ε−penalty solution oran ε−ε−ε−alternative.

Page 11: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1107

Additionally we define the solution B∞ of the problem

lex minB∈S

(p(B), w(B)) (minimisation with respect to the lexicographical order),

which has a minimal value p(B) and among all such solutions a minimal value w(B).

Remark. If both w and p are positive real-valued functions, there is a symmetryin the optimal solutions: B∗ is an ε−penalty solution (0 < ε <∞) for the functionpair (w, p), if and only if B∗ is a 1

ε−penalty solution for the pair (p, w).

To preserve this symmetry it makes sense to define B0 as an optimal solution ofthe problem

lex minB∈S

(w(B), p(B)) .

That means B0 is not only an optimal solution for the objective function w, butamong all such solutions it has also a minimal p-value.

Example 23.4 We formulate the concrete Example 23.1 from page 1105 in this abstract∑-type formulation. We know the shortest path PD from S to T and search for a “good”

alternative solution. The penalty function p is defined by

p(e) =

{w(e) if e is an edge of the shortest path PD ,

0 else .

Finding penalty solutions for all parameters ε ≥ 0. Often it is a priorinot clear which choice of the penalty parameter ε produces good and interestingalternative solutions. With a “divide-and-conquer” algorithm one is able to find allsolutions which can be produced by any parameter ε.

For finite sets S we give an efficient algorithm which generates a “small” setB ⊆ S of solutions with the following properties.

• For each element B ∈ B there exists an ε ∈ R+ ∪{∞} such that B is an optimal

solution for the penalty parameter ε.

• For each ε ∈ R+ ∪ {∞} there exists an element B ∈ B such that B is optimal

for the penalty parameter ε.

• B has a minimal number of elements among all systems of sets which have thetwo properties above.

We call a solution B which is optimal for at least one penalty parameter penalty-

optimal. The following algorithm finds a set of penalty-optimal solutions whichcovers all ε ∈ R

+ ∪ {∞}.For easier identification we arrange the elements of the set B in a fixed order

(Bε(1), Bε(2), . . . , Bε(k)), with 0 = ε(1) < ε(2) < · · · < ε(k) =∞.The algorithm has to check that for ε(i) < ε(i+1) there is no ε with ε(i) < ε < ε(i+1)such that for this penalty parameter ε neither Bε(i) nor Bε(i+1) is optimal. Otherwiseit has to identify such an ε and an ε-penalty solution Bε. In step 11 of the pseudocode below the variable Border(i) is set to 1 if it turns out that such an intermediateε does not exist.

We present the pseudocode and give some remarks.

Page 12: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1108 23. Human-Computer Interaction

Algorithm for finding a sequence B of penalty-optimal solutions covering

all ε ≥ 0 for the problem

minB∈S

fε(B)

with fε(B) = w(B) + ε · p(B) .

Divide-and-Cover(w, p)

1 compute B0, which minimises w(B) and has a p(B)-value as small as possible.2 compute B∞, which minimises p(B) and has a w(B)-value as small as possible.3 if p(B0) = p(B∞)4 then B ← {B0}; E ← (0); Border← ∅

(B0 minimises the functions w and p and is optimal for all ε.)5 else k ← 2; E = (ε(1), ε(2))← (0,∞); Border(1)← 0; B ← (B0, B∞).6 while There is an i ∈ {1, 2, . . . , k − 1} with Border(i) = 0.

7 do ε←w(Bε(i+1))−w(Bε(i))

p(Bε(i))−p(Bε(i+1))

8 Find an optimal solution Bε for the parameter ε.9 if fε(Bε) = fε(Bε(i)) = fε(Bε(i+1))

10 then Border(i)← 111 else B ← (Bε(1), . . . , Bε(i), Bε, Bε(i+1), . . . , Bε(k))12 E ← (ε(1), . . . , ε(i), ε, ε(i + 1), . . . , ε(k))13 Border← (Border(1), . . . , Border(i), 0,Border(i + 1),. . . ,

Border(k − 1))14 k ← k + 115 return B, E , Border

At the end B is a sequence of different penalty-optimal solutions and the vectorE includes consecutive epsilons.

This algorithm is based on the following properties:

(1) If B is an ε-optimal solution then there exists an interval IB = [εl, εh], εl, εh ∈R ∪ {∞}, such that B is optimal for all penalty parameters ε ∈ IB and for noother parameters.

(2) For two different solutions B and B′ with nonempty optimality intervals IB andIB′ , only three cases are possible.

∗ IB = IB′ . This happens iff w(B) = w(B′) and p(B) = p(B′).∗ IB and IB′ are disjoint.∗ IB ∩ IB′ = {ε}, this means the intersection contains only a single epsilon.

This happens if IB and IB′ are neighbouring intervals.

By finiteness of E there are only finitely many feasible solutions B ∈ S.So, there can be only finitely many optimality intervals. Hence, (1) and (2)show that the interval [0,∞] can be decomposed into a set of intervals {[0 =ε1, ε2], [ε2, ε3], . . . , [εk, εk+1 =∞]}. For each interval we have a different solutionB which is optimal for all ε in this interval. We call such a solution an interval

representative.

Page 13: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1109

(3) The aim of the algorithm is to find the borders of such optimality intervalsand for each interval a representing solution. In every iteration step an intervalrepresentative of a new interval or a new border between two different intervalswill be found (in steps 7–13). When there are k optimality intervals with k ≥ 2it is sufficient to solve 2k− 1 problems of the type min

B∈Sw(B) + ε · p(B) to detect

all of them and to find representing solutions.

Unimodality property of the alternatives. When only one ε-alternativeshall be computed the question comes up which penalty parameter should be usedto produce a “best possible” alternative solution. If the penalty parameter is toosmall the optimal and the alternative solution are too similar and offer no realchoice. If the parameter is too large the alternative solution becomes too poor. Thebest choice is to take some "medium" ε.

We illustrate this effect in the following route planning example.

Example 23.5 Assume that we have to plan a route from a given starting point to a giventarget. We know the standard travel times of all road sections and are allowed to plan fortwo different routes. In last minute we learn about the real travel times and can choose thefastest of our two candidate routes.

Let the first route be the route with the smallest standard travel time and the secondone a route found by the penalty method. Question: Which penalty parameter should weuse to minimise the real travel time of the fastest route?

Concretely, consider randomly generated instances of the shortest path problem ina weighted directed grid graph G = (V, E, w) of dimension 25 × 25. The weights of thearcs are independently uniformly distributed in the unit interval [0, 1]. We compute P0,a path from the lower left corner to the upper right with minimal weight. Afterwards wepunish the edges of path P0 by multiplying by 1 + ε and calculate a whole set of ε-penaltysolutions Pε1 , Pε2 , . . . , Pε30 for ε = 0.025, 0.050, . . . , 0.750. We get 30 solution pairs{S0, Sε1 }, {S0, Sε2 }, . . . , {S0, Sε30 } and can compare these.

The weight w(e) of an arc e is the standard travel time without time lags, i.e. theminimal needed travel time on a free road without any traffic jam. The real travel timew(e) of this arc may differ from w(e) as follows:

w(e) =

{λc(e) · w(e) : with probability p

w(e) : with probability 1 − p

independently for all edges e. Here the λc(e) are independent random numbers, uniformlydistributed in the interval [1, c]. The parameter 0 ≤ p ≤ 1 is called failure probability

and the parameter c ≥ 1 is called failure width.For every pair {S0, Sεi

} we calculate the minimum of the two function values w(S0)and w(Sεi

). To get a direct impression of the benefit of having two solutions instead of onewe scale with respect to the real value of the optimal solution S0.

φεi=

min{w(S0), w(Sεi)}

w(S0)for i = 1, . . . , 30 .

We computed the values φεifor 100,000 randomly generated 25 × 25 grid graphs with

failure probability p = 0.1 and failure width c = 8. Figure 23.3 shows the averages φεi

forε1 = 0.025, ε2 = 0.050, . . . , ε30 = 0.750.

Page 14: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1110 23. Human-Computer Interaction

90

92

94

96

98

100

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0.60

0.65

0.70

0.75

εεεε

%

Figure 23.3 φεifor ε1 = 0.025, ε2 = 0.050, . . . , ε30 = 0.750 on 25 × 25 grids.

As seen in Figure 23.3, the expected quality φε of the solution pairs is unimodal inε. That mean that φε first decreases and then increases for growing ε. In this exampleε∗ ≈ 0.175 is the optimal penalty parameter.

In further experiments it was observed that the optimal parameter ε∗ is decreasing inthe problem size (e.g. ε∗ ≈ 0.6 for shortest paths in 5 × 5-grids, ε∗ ≈ 0.175 for 25 × 25 andε∗ ≈ 0.065 for 100 × 100 grid graphs).

Monotonicity properties of the penalty solutions. Independently whetherall ε-penalty solutions are generated or only a single one (as in the prevoius pages),the following structural properties are provable: With increasing penalty factor ε weget solutions Bε where

• the penalty part p of the objective function is fitted monotonically better (thesolution contains less punished parts),

• the original objective function w is getting monotonically worse, in compensationfor the improvement with respect to the penalty part.

These facts are formalised in the following theorem.

Theorem 23.3 Let w : E → R be a real-valued function and p : E → R+ a positive

real-valued function on E. Let Bε be defined for ε ∈ R+ according to Definition 23.2.

The following four statements hold:(i) p(Bε) is weakly monotonically decreasing in ε.(ii) w(Bε) is weakly monotonically increasing in ε.(iii) The difference w(Bε)− p(Bε) is weakly monotonically increasing in ε.(iv) w(Bε) + ε · p(Bε) is weakly monotonically increasing in ε.

Proof Let δ and ε be two arbitrary nonnegative real numbers with 0 ≤ δ < ε.

Page 15: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1111

Because of the definition of Bδ and Bε the following inequalities hold.

(i) In case ε <∞ we have

w(Bε) + ε · p(Bε) ≤ w(Bδ) + ε · p(Bδ) , (23.1)

w(Bε) + δ · p(Bε) ≥ w(Bδ) + δ · p(Bδ) . (23.2)

Subtracting (23.2) from (23.1) we get

(ε− δ) · p(Bε) ≤ (ε− δ) · p(Bδ) | : (ε− δ) > 0

⇔ p(Bε) ≤ p(Bδ) . (23.3)

In case ε =∞ inequality (23.3) follows directly from the definition of B∞ .

(ii) Subtracting (23.3) multiplied with δ from (23.2) we get

w(Bε) ≥ w(Bδ). (23.4)

(iii) Subtracting (23.3) from (23.4) we get

w(Bε)− p(Bε) ≥ w(Bδ)− p(Bδ).

(iv) With (23.2) and ε > δ ≥ 0 we have

w(Bδ) + δ · p(Bδ) ≤ w(Bε) + δ · p(Bε) ≤ w(Bε) + ε · p(Bε)

⇒ w(Bε) + ε · p(Bε) ≥ w(Bδ) + δ · p(Bδ) .

Generating more than one alternative solution for the same penalty

parameter ε. If we have a solution S0 and want to get more than one alternativesolution we can use the penalty method several times by punishing S0 with differentpenalty parameters ε1 < · · · < εm, getting alternative solutions Sε1

, Sε2, . . . , Sεm

.This method has a big disadvantage, because only the shared parts of the mainsolution S0 and each alternative solution are controlled by the values εi. But thereis no direct control of the parts shared by two different alternative solutions. So, Sεi

and Sεjmay be rather similar for some i 66= j.

To avoid this effect the penalty method may be used iteratively for the same ε.

Iterative-Penalty-Method(w, p, k, ε)

1 solve the original problem min w(B) and find the optimal solution S0.2 define the penalty function as p1(B)← ε · w(B ∩ S0).3 solve the modified problem min w(B) + ε · p1(B) and find the solution S1.4 for j ← 2 to k

5 do pj(B)← ε · w(B ∩ S0) + ε · w(B ∩ S1) + · · ·+ ε · w(B ∩ Sj−1)6 solve the modified problem min w(B) + ε · pj(B) and find the solution Sj .7 return (S0, S1, . . . , Sk)

Step 5 may be replaced by the variant 5∗

5∗ do pj(B)← ε · w(B ∩ (S0 ∪ S1 ∪ · · · ∪ Sj−1))

Page 16: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1112 23. Human-Computer Interaction

In the first case (5) a part of a solution belonging to r of the j solutions S0, S1, . . .

and Sj−1 is punished by the factor r · ε. In the second case (5∗) a part of a solutionis punished with multiplicity one if it belongs to at least one of S0, S1, . . . or Sj−1.

The differences in performance are marginal. However, in shortest path problemswith three solutions S0, S1 and S2 setting (5) seemed to give slightly better results.

Example 23.6 Take the graph G = (V, E) from Figure 23.2. For penalty parameter ε = 0.1we want to find three solutions. The shortest path from S to T is PD via S - A - C - D -F - T with length 23. Multiplying all edges of PD by 1.1 and solving the obtained shortestpath problem gives the alternative solution PB via S - A - B - F - T .

Applying setting (5) we have to multiply the edge lengths of (A, C), (C, D), (D, F ),(A, B) and (B, F ) by penalty factor 1.1. The edges (S, A) and (F, T ) have to be multipliedby factor 1.2 (double penalty). The optimal solution is path PH via S - G - H - T .

Applying setting (5∗) we have to multiply the edge lengths (S, A), (A, C), (C, D),(D, F ), (F, T ), (A, B) and (B, F ) by penalty factor 1.1. The optimal solution of this mod-ified problem is path PE via S - A - C - E - F - T .

23.2.3. The linear programming - penalty method

It is well known that shortest path problems as well as many other network flowproblems can be solved with Linear Programming. Linear Programming may alsobe used to generate alternative solutions. We start with the description of LinearProgramming for the basic shortest path problem.

The shortest path problem formulated as a linear program.

Consider a directed graph G = (V, E) and a function w : E → R+ assigning a

length to every arc of the graph. Let s and t be two distinguished nodes of G.Which is the shortest simple path from s to t in G?For every arc e = (i, j) ∈ E we introduce a variable xe. Here xe shall be 1 if e is

part of the shortest path and xe shall be 0 otherwise.With S(i) = {j ∈ V : (i, j) ∈ E} ⊆ V we denote the set of the successors of node

i and with P (i) = {j ∈ V : (j, i) ∈ E} ⊆ V we denote the set of the predecessors ofnode i. The linear program LPShortestP ath is formulated as follows:

min∑

e∈E

w(e) · xe

s.t.∑

j∈S(s)

x(s,j) −∑

j∈P (s)

x(j,s) = 1 flow-out condition for the starting node s

j∈S(t)

x(t,j) −∑

j∈P (t)

x(j,t) = −1 flow-in condition for the target node t

j∈S(i)

x(i,j) −∑

j∈P (i)

x(j,i) = 0 for all nodes i ∈ V \{s, t}

Kirchhoff conditions for all interior nodes

0 ≤ xe ≤ 1 for all e ∈ E.

Page 17: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1113

1 1 1

1 1.1

1.2 1S TB

C

A

D

Figure 23.4 Example graph for the LP-penalty method.

By the starting and target conditions node s is a source and node t is a sink. Becauseof the Kirchhoff conditions there are no other sources or sinks. Therefore theremust be a "connection" from s to t.

It is not obvious that this connection is a simple path. The variables xe mighthave non-integer values or there could be circles anywhere. But there is a basictheorem for network flow problems [1, p. 318] that the linear program LPShortestP ath

has an optimal solution where all xe > 0 have the value 1. The according arcs withxe = 1 represent a simple path from s to t.

Example 23.7 Consider the graph in Figure 23.4. The linear program for the shortestpath problem in this graph contains six equality constraints (one for each node) and sevenpairs of inequality constraints (one pair for each arc).

min(xSA + xSB + xBC + xCT + xDT ) · 1 + xAC · 1.1 + xBD · 1.2

s.t. xSA + xSB = 1,

xCT + xDT = 1 ,

xSA − xAC = 0,

xSB − xBC − xBD = 0 ,

xAC + xBC − xCT = 0,

xBD − xDT = 0 ,

0 ≤ xSA, xSB , xAC , xBC , xBD, xCT , xDT ≤ 1 .

The optimal solution has xSB = xBC = xCT = 1 .

A linear program which gives two alternative paths from s to t

Here we give an LP -representation for the task to find two alternative routes froms to t.

For every arc e = (i, j) ∈ E we introduce two variables xe and ye. If the arc e

is used in both routes, then both xe and ye shall have the value 1. If e is a part ofonly one route, xe shall be 1 and ye shall be 0. Otherwise xe and ye shall both be 0.ε > 0 is a penalty parameter to punish arcs used by both routes.

Page 18: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1114 23. Human-Computer Interaction

With this in mind we can formulate the linear program LP2−ShortP aths

min f(x, y) :=∑

e∈E

w(e) · xe + (1 + ε) · w(e) · ye

s.t.∑

j∈S(s)

x(s,j) + y(s,j) −∑

j∈P (s)

x(j,s) + y(j,s) = 2 condition for the starting node s

j∈S(t)

x(t,j) + y(t,j) −∑

j∈P (t)

x(j,t) + y(j,t) = −2 condition for the target node t

j∈S(i)

x(i,j) + y(i,j) −∑

j∈P (i)

x(j,i) + y(j,i) = 0 Kirchhoff conditions

for all i ∈ V \{s, t}

0 ≤ xe, ye ≤ 1 for all e ∈ E .

Example 23.8 Consider again the graph in Figure 23.4. The linear program for the 2-alternative-paths problem in this graph contains six equality constraints (one for eachnode) and 2 · 7 = 14 pairs of inequality constraints.

min (xSA + xSB + xBC + xCT + xDT ) · 1 + xAC · 1.1 + xBD · 1.2

+[(ySA + ySB + yBC + yCT + yDT ) · 1 + yAC · 1.1 + yBD · 1.2

]· (1 + ε)

s.t. xSA + ySA + xSB + ySB = 2,

xCT + yCT + xDT + yDT = 2 ,

xSA + ySA − xAC − yAC = 0,

xSB + ySB − xBC − yBC − xBD − yBD = 0 ,

xAC + yAC + xBC + yBC − xCT − yCT = 0,

xBD + yBD − xDT − yDT = 0 ,

0 ≤ xSA, xSB , xAC , xBC , xBD, xCT , xDT , ySA, ySB , yAC , yBC , yBD, yCT , yDT ≤ 1 .

This linear program can be interpreted as a minimal cost flow problem.Where is the connection between the linear program and the problem to find

two candidate routes from s to t?

Theorem 23.4 If the linear program LP2−ShortP aths has an optimal solution thenit has also an optimal solution (x, y) with the following properties.There are disjoint sets E1, E2, E3 ⊆ E with(i) E1 ∩ E2 = ∅, E1 ∩ E3 = ∅ and E2 ∩ E3 = ∅,(ii) xe = 1, ye = 0 for all e ∈ E1 ∪ E2,(iii) xe = 1, ye = 1 for all e ∈ E3,(iv) xe = 0, ye = 0 for all e 6∈ E1 ∪ E2 ∪ E3.(v) E1 ∪E3 represents a path P1 from s to t and E2 ∪E3 represents a path P2 froms to t. E3 is the set of arcs used by both paths.

Page 19: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.2. Generating multiple candidate solutions 1115

a

b

c

d

e

f

g

hS T

Figure 23.5 An example for a non-unique decomposition in two paths.

(vi) No other pair (Q1, Q2) of paths is better than (P1, P2), i.e.,

w(P1) + w(P2) + ε · w(P1 ∩ P2) ≤w(Q1) + w(Q2) + ε · w(Q1 ∩Q2) ,

for all pairs (Q1, Q2) .

That means the sum of the lengths of P1 and P2 plus a penalty for arcs used twiceis minimal.

We conclude with some remarks.

• For each arc e there are two variables xe and ye. This can be interpreted as astreet with a normal lane and an additional passing lane. Using the passinglane is more expensive than using the normal lane. If a solution uses an arc onlyonce, it takes the cheaper normal lane. But if a solution uses an arc twice, it hasto take both the normal and the passing lane.

• The decomposition of the solution (x, y) into two paths from the starting nodeto the target node is in most cases not unique. With the arcs a, b, . . . , g, h inFigure 23.5 we can build two different pairs of paths from S to T , namely (a−c − e − g, b − d − f − h) and (a − c − f − h, b − d − e − g). Both pairs areequi-optimal in the sense of Theorem 23.4. So the user has the chance to choosebetween them according to other criteria.

• The penalty method and the LP-penalty method generally lead to different re-sults. The penalty method computes the best single solution and a suitablealternative. The LP-penalty method computes a pair of good solutions with rel-atively small overlap. Figure 23.4 shows that this pair not necessarily containsthe best single solution. The shortest path from S to T is P1 = S–B–C–T withlength 3. For all ε > 0.1 the ε-penalty solution is P2 = S–A–C–T . The path pair(P1, P2) has a total lengths of 6.1 and a shared length of 1.0. But for ε > 0.2 theLP-Penalty method produces the pair (P2, P3) = (S–A–C–T, S–B–D–T ) with atotal length of 6.3 and a shared length of zero.

• Finding k candidate routes for some larger number k > 2 is possible, if weintroduce k variables x0

e, x1e, . . . , xk−1

e for each arc e and set the supply of s and

Page 20: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1116 23. Human-Computer Interaction

the demand of t to k. As objective function we can use for instance

min f(x0, . . . , xk−1) :=∑

e∈E

k−1∑

j=0

(1 + j · ε) · w(e) · xje

or

min f(x0, . . . , xk−1) :=∑

e∈E

k−1∑

j=0

(1 + ε)j · w(e) · xje .

• The LP-penalty method does not only work for shortest path problems. It canbe generalised to arbitrary problems solvable by linear programming.

• Furthermore an analogous method – the Integer Linear Programming PenaltyMethod – can be applied to problems solvable by integer linear programming.

23.2.4. Penalty method with heuristics

In Subsection 23.2.2 we discussed the penalty method in combination with exactsolving algorithms (e.g. Dijkstra-algorithm or dynamic programming for the shortestpath problem). But also in case of heuristics (instead of exact algorithms) the penaltymethod can be used to find multiple candidate solutions.

Example 23.9 A well known heuristic for the TSP-problem is local search with 2-exchangesteps (cp. Subsection 23.2.1).

Penalty-Method-for-the-TSP-Problem-with-2-Exchange-Heuristic

1 apply the 2-exchange heuristic to the unpunished problem getting a locally (butnot necessarily globally) optimal solution T

2 punish the edges belonging to T by multiplying their lengths with 1 + ε

3 apply the 2-exchange heuristic to the punished problem getting an alternativesolution Tε

4 compute the unmodified length of Tε

5 the pair (T, Tε) is the output

Question: Which penalty parameter ε ≥ 0 should be used to minimise the travel timeof the fastest route?

An experiment analogous to the one described in Example 23.5 was executed for TSPinstances with 25 random cities in the unit square. Figure 23.6 shows the scaled averagesfor ε0 = 0.000, ε1 = 0.025, . . . , ε30 = 0.750. So, the expected quality φε of the solutionpairs is (again) unimodal in the penalty factor ε. That means that φε first decreases andthen increases for growing ε. In this example ε∗ ≈ 0.175 is the optimal penalty parameter.

In further experiments it was observed that the optimal penalty parameter ε∗ is de-creasing in the problem size.

Exercises23.2-1 The following programming exercise on the Travelling Salesperson Problemhelps to get a feeling for the great variety of local optima. Generate 200 random

Page 21: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.3. More algorithms for interactive problem solving 1117

98

99

100

101

102

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0.60

0.65

0.70

0.75

εεεε

%

Figure 23.6 φεifor ε0 = 0, ε1 = 0.025, . . . , ε30 = 0.750 on 25 × 25 grids.

points in the 2-dimensional unit-square. Compute distances with respect to theEuclidean metric. Make 100 runs of local search with random starting tours and2-exchanges. Count how many different local minima have been found.23.2-2 Enter the same key words into different internet search engines. Comparethe hit lists and their diversities.23.2-3 Formulate the Travelling Salesperson Problem as a

∑-type problem.

23.2-4 Proof the assertion of the remark on page 1107.23.2-5 How does the penalty function p(e) look like in case of additive penaltieslike in Example 23.2?23.2-6 Prove the properties (1) and (2) on page 1108.23.2-7 Apply the Divide and cover algorithm (page 1108) to the shortest pathproblem in Figure 23.2 with starting node S and target node T . Set w(e) = lengthof e for each road section, and p(e) = length of e for the road sections belonging tothe shortest path PD via S - A - C - D - F - T and p(e) = 0 for all other sections.So, the penalty value of a whole path is the length of this part shared with PD.23.2-8 Find a penalty parameter ε > 0 for Example 23.6 such that the first set-ting (5) produces three different paths but the second setting (5∗) only two differentpaths for k = 3.

23.3. More algorithms for interactive problem solving

There are many other settings where a human controller has access to computer-generated candidate solutions. This section lists four important cases and concludeswith a discussion of miscellaneous stuff.

Page 22: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1118 23. Human-Computer Interaction

23.3.1. Anytime algorithms

In an anytime-setting the computer starts to work on a problem, and almost from thevery first moment on candidate solutions (the best ones found so far) are shown onthe monitor. Of course, the early outputs in such a process are often only preliminaryand approximate solutions – without guarantee of optimality and far from perfect.

An example: Iterative deepening performs multiple depth-limited searches –gradually increasing the depth limit on each iteration of the search. Assume thatthe task is to seek good solutions in a large rooted tree T = (V, E). Let f : V → R

be the function which is to be maximised. Let Vd be the set of all nodes in the treeat distance d from root.

Iterative-Deepening-Tree-Search(T, f)

1 Opt ← f(root)2 d← 13 while d <∞4 do Determine maximum Maxd of f on Vd

5 if Maxd > Opt6 then Opt ← Maxd

7 d← d + 1

All the time the currently best solution (Opt) is shown on the monitor. Theoperator may stop at any moment.

Iterative deepening is not only interesting for HCI but has also many applica-tions in fully automatic computing. A prominent example is game tree search: Intournament chess a program has a fixed amount of time for 40 moves, and iterativedeepening is the key instrument to find a balanced distribution of time on the singlealpha-beta searches.

Another frequent anytime scenario is repeated application of a heuristic. Let f :A→ R be some complicated function for which elements with large function valuesare searched. Let H be a probabilistic heuristic that returns a candidate solutionfor this maximisation problem (A, f). For instance, H may be local search or someother sort of hill-climbing procedure. H is applied again and again in independentruns, and all the time the best solution found so far is shown.

A third anytime application is in Monte Carlo simulations, for instance in MonteCarlo integration. A static approach would take objective values at a prescribednumber of random points (1,000 or so) and give the average value in the output.However, already the intermediate average values (after 1, 2, 3 etc. data points – orafter each block of 10 or 50 points) may give early indications in which region thefinal result might fall and whether it really makes sense to execute all the many runs.Additional display of variances and frequencies of outliers gives further informationfor the decision when best to stop the Monte Carlo run.

In human-computer systems anytime algorithms help also in the following way:during the ongoing process of computing the human may already evaluate and com-pare preliminary candidate solutions.

Page 23: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

23.3. More algorithms for interactive problem solving 1119

23.3.2. Interactive evolution and generative design

Genetic Algorithms are search algorithms based on the mechanics of natural selectionand natural genetics. Instead of single solutions whole populations of solutions aremanipulated. Genetic Algorithms are often applied to large and difficult problemswhere traditional optimisation techniques fall short.

Interactive evolution is an evolutionary algorithm that needs human interaction.In interactive evolution, the user selects one or more individual(s) of the currentpopulation which survive(s) and reproduce(s) (with mutations) to constitute thenew generation. So, in interactive evolution the user plays the role of an objectivefunction and thus has a rather active role in the search process.

In fields like art, architecture, and photo processing (including the design ofphantom photos) Generative Design is used as a special form of interactive evolu-tion. In Generative Design all solutions of the current generation are shown simul-taneously on the screen. Here typically "all" means some small number N between4 and 20. Think of photo processing as an example, where the user selects mod-ified contrast, brightness, colour intensities, and sharpness. The user inspects thecurrent candidate realizations, and by a single mouse click marks the one whichhe likes most. All other solutions are deleted, and N mutants of the marked oneare generated. The process is repeated (open end) until the user is happy with theoutcome. For people without practical experience in generative design it may soundunbelievable, but even from poor starting solutions it takes the process often only afew iterations to come to acceptable outcomes.

23.3.3. Successive fixing

Many problems are high-dimensional, having lots of parameters to adjust. If sets ofgood solutions in such a problem are generated by repeated probabilistic heuristics,the following interactive multi-stage procedure may be applied: First of all severalheuristic solutions are generated and inspected by a human expert. This humanespecially looks for "typical" pattern in the solutions and "fixes" them. Then moreheuristic solutions are generated under the side condition that they all contain thefixed parts. The human inspects again and fixes more parts. The process is repeateduntil finally everything is fix, resulting in one specific (and hopefully good) solution.

23.3.4. Interactive multicriteria decision making

In multicriteria decision making not only one but two or more objective functionsare given. The task is to find admissible solutions which are as good as possible withrespect to all these objectives. Typically, the objectives are more or less contradictory,excluding the existence of a unanimous optimum. Helpful is the concept of "efficientsolutions", with the following definition: For an efficient solution there exists no othersolution which is better with respect to at least one objective and not worse withrespect to all the others.

A standard first step in multicriteria decision making is to compute the set ofall efficient solutions. In the bicriteria case the "efficient frontier" can be visualizedin a 2-dimensional diagram, giving the human controller a good overview of what is

Page 24: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1120 23. Human-Computer Interaction

possible.

23.3.5. Miscellaneous

• Graphical Visualisation of Computer SolutionsIt is not enough that a computer generates good candidate solutions. The resultsalso have to be visualized in appropriate ways. In case of a single solution im-portant parts and features have to be highlighted. And, even more important, incase of concurring solutions their differences and specialities have to be stressed.

• Permanent Computer Runs with Short Intermediate Human ControlA nickname for this is "1+23h mode", coming from the following picture: Eachday the human sits in front of the computer for one hour only. In this hour helooks at the computer results from the previous 23 hours, interacts with themachine and also briefs the computer what to do in the next 23 hours. So, thehuman invests only a small portion of his time while the computer is runningpermanently.

An impressive example comes from correspondence chess. Computer help is of-ficially permitted. Most top players have one or several machines running allaround the clock, analysing the most critical positions and lines of play. Thehuman players collect these computer results and analyse only shortly per day.

• Unexpected Errors and Numerical Instabilities"Every software has errors!" This rule of thumb is often forgotten. People toooften simply believe what the monitor or the description of a software productpromises. However, running independent programs for the very same task (witha unique optimal solution) will result in different outputs unexpectedly often.Also numerical stability is not for free. Different programs for the same problemmay lead to different results, due to rounding errors. Such problems may berecognised by applying independent programs.

Of course, also hardware has (physical) errors, especially in times of ongoingminiaturisation. So, in crucial situations it is a good strategy to run an identicalprogram on fully independent machines - best of all operated by independenthuman operators.

Exercises23.3-1 For a Travelling Salesperson Problem with 200 random points (xi, yi) inthe unit square [0, 1] × [0, 1] and Euclidean distances, generate 100 locally optimalsolutions (with 2-exchanges, see Subsection 23.2.1) and count which edges occur howoften in these 100 solutions. Define some threshold K (for instance K = 30) andfix all edges which are in at least K of the solutions. Generate another 100 localoptima, without allowing the fixed edges to be exchanged. Repeat until convergenceand compare the final result with typical local optima from the first series.

Page 25: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

Notes for Chapter 23 1121

Chapter Notes

In the technical report [?] lots of experiments on the penalty method for varioussum type problems, dimensions, failure widths and probabilities are described andanalysed. The proof of Theorem 23.3 was originally given in [?]) . In e-commercemultiple-choice systems are often called "Recommender Systems" [10], having inmind customers for whom interesting products have to be listed. Understandably,commercial search engines and e-companies keep their shortlisting strategies secret.

A good class book on Genetic Algorithms is [8]. Interactive Evolution and Gener-ative Design are described in [6]. There is a lot of literature on multicriteria decisionmaking, one of the standard books being [7].

In the book [2] the story of 3-Hirn and its successes in tournament chess istold. The final match between "3-Hirn" and GM Yussupov is described in [3].[4] gives more general information on improved game play by multiple computerhints. In [5] several good k-best realizations of iterative deepening in game treesearch are exhibited and discussed. Screenshots of these realizations can be inspectedat http://www.minet.uni-jena.de/www/fakultaet/iam/personen/k-best.html. [9] de-scribes the technical background of advanced programs for playing chess and othergames.

There is a nice online repository, run by M. Zuker and D.H. Turner athttp://www.bioinfo.rpi.edu/applications/mfold/. The user may enter for instanceRNA-strings, and in realtime alternative foldings for these strings are generated.Amongst other data the user may enter parameters for "maximum number of com-puted foldings" (default = 50) and "percent suboptimality number" (default = 5 %).

Page 26: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

Bibliography

[1] R. K. Ahuja, T. L. Magnanti, J. B. Orlin. Network Flows: Theory, Algorithms, and Applica-

tions. Prentice Hall, 1993. 1113

[2] I. Althöfer. 13 Jahre 3-Hirn. Published by the author, 1998. 1121

[3] I. Althöfer. List-3-Hirn vs. grandmaster Yussupov – report on a very experimental match.ICCA Journal, 21:52–60 and 131–134, 1998. 1121

[4] I. Althöfer. Improved game play by multiple computer hints. Theoretical Computer Science,313:315–324, 2004. 1121

[5] I. Althöfer, J. de Koning, J. Lieberum, S. Meyer-Kahlen, T. Rolle, J. Sameith. Five visualisa-tions of the k-best mode. ICCA Journal, 26:182–189, 2003. 1121

[6] W. Banzhaf. Interactive evolution. In T. Back, D. B. Fogel, Z. Michalewicz, T. Baeck (Eds.)Handbook of Evolutionary Computation. IOP Press, 1997. 1121

[7] T. Gal, T. Stewart, T. Hanne. (Eds.). Multicriteria Decision Making. Kluwer Academic Pub-lisher, 1999. 1121

[8] D. E. Goldberg. Genetic Algorithms in Search, Optimization, and Machine Learning.Addison-Wesley, 1989. 1121

[9] E. A. Heinz. Algorithmic Enhancements and Experiments at High Search Depths. Vieweg

Verlag, Series on Computational Intelligence, 2000. 1103, 1121

[10] P. Resnick, H. R. Varian. Recommender Systems. Communications of the ACM, 40(3):56–58,1997. 1121

This bibliography is made by HBibTEX. First key of the sorting is the name of theauthors (first author, second author etc.), second key is the year of publication, thirdkey is the title of the document.

Underlying shows that the electronic version of the bibliography on the homepageof the book contains a link to the corresponding address.

Page 27: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

Index

This index uses the following conventions. Numbers are alphabetised as if spelled out; forexample, “2-3-4-tree" is indexed as if were “two-three-four-tree". When an entry refers to a placeother than the main text, the page number is followed by a tag: exe for exercise, exa for example,fig for figure, pr for problem and fn for footnote.

The numbers of pages containing a definition are printed in italic font, e.g.

time complexity, 583 .

Aalternatives, true, 1098anytime algorithm, 1103, 1118assignment problem, 1106

Bbase set, 1106branch and bound, 1101

Ccandidate solutions, 1097–1099, 1101, 1117chess, 1100, 1118clustering algorithms, 1101computational biology, 1101

Ddecision maker, 1098divide-and-conquer algorithm, 1107Divide-and-Cover, 1108dynamic programming, 1101

Ee-commerce, 1100efficient solutions, 1119

Ffeasible solution, 1106feasible subset, 1106final choice, 1097, 1100

Ggenerative design, 1119genetic algorithm, 1102, 1119graphical visualisation, 1120gravity assist, 1100

Hheuristic, 1101, 1102, 1116, 1118, 1119

exchange, 1102, 1103insertion, 1102

human-computer interaction, 1097

IInsertion-Heuristic-for-TSP, 1102integer linear programming, 1116interactive evolution, 1119iterative deepening, 1103, 1118Iterative-Deepening-Tree-Search, 1118Iterative-Penalty-Method, 1111

Kk-best algorithm, 1098knapsack problem, 1106

Llinear programming, 1112local search, 1118

with 2-exchange steps, 1102, 1116, 1117Local-Search-with-2-Exchanges-for-

TSP,1102

Mmicro mutations, 1098, 1104Monte Carlo integration, 1118multicriteria decision making, 1119multiple-choice algorithm, 1098multiple-choice optimisation, 1097, 1098multiple-choice system, 1097, 1098, 1101exe,

1103examples, 1098

multiple-choice test, 1098

Page 28: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

1124 Index

Nnetwork flow problems, 1112NP-complete problems, 1099, 1101numerical instabilities, 1120

Ppenalty function

additive penalties, 1105, 1117exerelative penalty factors, 1104, 1107

penalty method, 1103, 1104, 1106

penalty method, iterative, 1111Penalty-Method-for-the-TSP-Problem-

with-2-Exchange-Heuristic,1116

Penalty-Method-with-Relative-

Penalty-Factors,1104

penalty-optimal, 1107penalty parameter, optimal, 1110, 1116perturbation of local optima, 1103

Rrealtime scenario, 1098recommender systems, 1100

RNA-foldings, 1101round trip, 1099route planning, 1104, 1109

Ssequence alignment problem, 1106shortest path problem, 1098, 1106, 1112shortlisting, 1100, 1101simulated annealing, 1102successive fixing, 1119sum type optimisation problem, 1106

T3-Hirn, 1100, 1103tiebreak situations, 1103Travelling Salesperson Problem (TSP), 1099,

1101, 1106, 1116, 1120exetriple brain, see 3-Hirn2-exchange, 11022-exchange, 1116, 1117

Vvehicle routing, 1098, 1105

Page 29: 23. Human-Computer Interactioncompalg.inf.elte.hu/~tony/Oktatas/FirstExpert/Chapter23HCI21Dece… · 23.1. Multiple-choice systems 1099 Figure 23.1 1000 shortest paths in a 100 ×

Name Index

This index uses the following conventions. If we know the full name of a cited person, then weprint it. If the cited person is not living, and we know the correct data, then we print also the yearof her/his birth and death.

AAhuja, Ravindra K., 1113, 1122Althöfer, Ingo, 1097, 1100, 1121, 1122

BBack, Thomas, 1122Baeck, Thomas, 1122Banzhaf, Wolfgang, 1121, 1122Berger, Franziska, 1099, 1105, 1121

FFogel, David B., 1122

GGal, T., 1122Goldberg, David E., 1121, 1122

HHanne, T., 1122Heinz, Ernst A., 1121, 1122

MMagnanti, Thomas L., 1113, 1122Meyer-Kahlen, Stefan, 1122Michalewicz, Zbigniew, 1122

OOrlin, James B., 1113, 1122

RResnick, Paul, 1121, 1122Rolle, T., 1122

SSameith, Jörg, 1121, 1122Schwarz, Stefan, 1097, 1121Stewart, T. J., 1122

TTurner, Douglas H., 1121

VVarian, Hal R., 1121, 1122

YYussupov, Arthur, 1100, 1121

ZZuker, Michael, 1121