• Nem Talált Eredményt

(Lucz, Iványi, Sótér [168]) Every football sequence is a sport sequence

In document Table of Contents (Pldal 85-91)

8. 25.8 Football tournaments

Lemma 25.46 (Lucz, Iványi, Sótér [168]) Every football sequence is a sport sequence

Proof. This assertion is a consequence of the definition of the football sequences.

If a loss sequence can be realized as a sport matrix, then the following algorithm Sport-Test constructs one of the sport matrices belonging to .

If the team has points, then it has at least draws, wins and

losses. These results are called obligatory wins, draws, resp. losses. Sport-test starts its work with the computation of and . Then it tries to distribute the remaining draws.

Input. : the number of players ;

: a victory satisfying sequence of length .

Output. : a logical variable. Its value is , if the input sequence is sport sequence, and otherwise;

Working variables. : cycle variable;

: columns of the sport matrix;

: sum of the numbers of obligatory wins, draws, resp. losses;

: global variables;

: the sum of the elements of the input sequence;

: the exact number of wins, draws, resp. losses.

IF or or 28 29 RETURN 30 31 RETURN

Sport-Test runs in time in all cases. The number of the sport sequences is denoted by . Concrete examples

Let us consider short input sequences illustrating the power of the linear testing algorithms.

If , then according to Lemma 25.34 [68] we have and . The monotone sequences are , , , , , , , , , . Among the monotone sequences there are 4 interval sequences: , , , and , so . Loss-Test does not help, therefore . Victory-Test excludes , so . Finally Sport-Test can not construct a sport matrix for and so it concludes . After further unsuccessful tests Football reconstructs and ,

following tests are unsuccessful, but Football reconstructs the remained seven sequences, therefore .

If , then according to Lemma 25.34 [68] we have and . The

number of paired sport sequences is . We now that , so our linear algorithms evaluate the input sequences correctly up to .

If , then , but our approximating algorithms end with , that is the quality of 5 sequences remains open.

8.2. 25.8.2 Polynomial testing algorithms of the draw sequences

Earlier we used a greedy approach to check whether the necessary number of draws is allocatable.

Definition 25.47 A sequence is called potential -draw sequence. The number of potential -draw sequences is denoted by .

Lemma 25.48 (Iványi, Lucz, Sótér [130]) If , then . Proof. The proof is similar to the proof of Lemma 25.34 [68].

Let us suppose we get a potential draw sequence. In this subsection we describe the testing algorithms Quick-Havel-Hakimi and Linear-Erdős-Gallai.

Quick Havel-Hakimi algorithm

Algorithm Quick-Havel-Hakimi-Test is based on the following classical theorem [100], [109], [166].

Theorem 25.49 (Havel [109], Hakimi [100]) If , then a nonincreasing sequence of positive integers is the outdegree sequence of a simple graph if and only if

is the outdegree sequence of some simple graph .

See [100], [109].

Comparison Based Ranking

If is for example a complete simple graph, then it contains edges and the direct application of Havel-Hakimi theorem requires time. We make an attempt to decide in linear time the pairability of a sequence of positive integers.

The first simple observation is the necessity of the condition for all . We have not to test this property since all our draw allocation algorithms guarantee its fulfilment. Another interesting condition is

Lemma 25.50 (Iványi, Lucz, Sótér [130]) If a nonincreasing sequence of positive integers is the outdegree sequence of a simple graph , then

and

Proof. The draw request of the teams must be covered by inner and outer draws. The first sum on the right side gives the exact number of usable outer draws, while the sum of the right side gives the exact number of the reachable inner draws. The minimum on the left side represent an upper bound of the possible inner draws.

If we substitute this upper bound with the precise value, then our formula becomes a sufficient condition, but the computation of this value by Havel-Hakimi theorem is dangerous for the linearity of the method.

Let's take a few example. If , then we have only one potential draw-sequence, which is accepted by Havel-Hakimi algorithm and satisfies (25.64) and (25.65).

If , then there are potential draw sequences. The methods are here also equivalent.

From one side we try to find an example for different decisions or try to find an exact proof of the equivalence of these algorithms.

Linear Erdős-Gallai algorithm

For given nondecreasing sequence of nonnegative integers the first elements of the sequence is called the head of the sequence and last elements are called the tail belonging to the th element of the sequence. The sum of the elements of the head is denoted by , while the sum of the element of the tail is denoted by . The sum is denoted by and is called the capacity of the tail belonging to . If is even, then is called even, otherwise the sequence is called odd sequence.

Another classical theorem on the testing of the potential draw sequences whether they are graphical is the theorem proved by Erdős and Gallai in 1960 [71].

Theorem 25.51 (Erdős, Gallai, [71]) If , the -regular sequence is graphical if and only if

and

Proof. See [52], [71], [253], [275].

Recently we could improve this theorem [130]. The algorithm Erdős-Gallai-Linear exploits, that is monoton. It determines the capacities in constant time. The base of the quick computation is thesequence containing pointers. For given sequence let , where points to the element of having the maximal index among such elements of which are greater or equal with .

Theorem 25.52 (Iványi, Lucz, Sótér [130]) If , the -regular sequence is graphical if and only if

and if , then

further if , then

Proof. (25.68) is the same as (25.66).

During the testing of the elements of by Erdős-Gallai-Linear there are two cases:

• if , then the contribution of the tail of equals to , since the contribution of the element is only .

• if , then the contribution of the tail of consists of two parts: equal to , while

for .

Therefore in the case we have

and in the case

The following program is based on Theorem 25.52 [76]. It decides on arbitrary -regular sequence whether it is graphicakl or not.

Input. : number of vertices ; : -regular sequence.

Output. : logical variable, whose value is , if the input is graphical, and it is , if the input is not graphical.

Work variables. and : cycle variables;

: is the sum of the first elements of the tested ;

Comparison Based Ranking

: is the maximum of the indices of such elements of , which are not smaller than ; : help variable to compute of the other elenments of the sequence ;

: help variable to compute the elements of the sequence . Linear-Erdős-Gallai

1 Line 01: initialization 2 FOR TO Lines 02–03:

computation of the elements of 3 4 IF odd Lines 04–

06: test of the parity 5 6 RETURN 7 Line 07:

initialization of 8 FOR DOWNTO Lines 08–09: setting of some pointers 9 10 FOR TO Lines 10–14: calculation of the

pointers 11 IF 12 FOR DOWNTO 13 14 15 FOR DOWNTO Lines 15–16: setting of some pointers 16

17 FOR TO Lines 17–23: test of 18 IF and 19 20 RETURN 21 IF and 22 23 RETURN 24 Lines 24–25: the program ends with value 25 RETURN

Theorem 25.53 (Iványi, Lucz [129], Iványi, Lucz, Sótér [130]) Algorithm Linear-Erdős-Gallai decides in time, whether an -regular sequence is graphical or not.

Proof. Line 1 requires time, lines 2–3 time, lines 4–6 time, line 07 time, line 08–09 time, lines 10–16 time, lines 17–23 time and lines 24–25 time, therefore the total time requirement of the algorithm is .

Until now the number of good sequences was known only for , see Online Encyclopedia of Integer Sequences [256]. Using the new and quick algorithms we determined for too [129], [130], [131]. Figure 25.6 contains the number of good sequences for , and also

for .

Figure 25.6. Number of binomial, head halfing and good sequences, further the ratio of

the numbers of good sequences for neighbouring values of .

Testing of the pairing sport property at cautious allocation of the draws

Sport-Test investigated, whether the scores allow to include draws into the sport matrix.

Let us consider the sport sequence . In a unique way we get the sport matrix

Figure 25.7. Sport table belonging to the sequence .

Here has no partners to make two draws, therefore is not a football sequence. Using the Havel-Hakimi algorithm [100], [109], [166] we can try to pair the draws of any sport matrix. If we received the sport matrix in a unique way, and Havel-Hakimi algorithms can not pair the draws, then the investigated sequence is not a football sequence.

Now consider the football sequence , which is the result of a

tournament of 7 weak, 14 medium and 7 strong teams. the weak player play draws among themselves and loss against the medium and strong teams. The medium teams form a transitive subtournament and loss against the strong teams. The strong teams play draws among themselves. We perturbate this simple structure: one of the weak teams wins against the best medium team instead of to lost the match. There are 42 draws in the

Comparison Based Ranking

tournament, therefore the sum of the multiplicities of the sport matrix has to be 84. A uniform distribution results for all determining the sport matrix in a unique way.

Let us consider the matches in the subtournament of . This subtournament consists of 21 matches, from which at most can end with draw, therefore at least matches have a winner, resulting at least inner points. But the seven teams have only points signalizing that that the given sport matrix is not a football matrix.

In this case the concept of inner draws offers a solution. Since and , the teams made at least 9 draws among themselves. ―Cautious‖ distribution results a draw sequence , which can be paired easily. Then we can observe that , while , so the teams have to made at least 18 draws. Cautious distribution results a draw sequence . Havel-Hakimi algorithm finishes the pairing with the draw sequence (2,2), so 2 draws remain unpaired. If we assign a further draw pack to this subtournament, then the uniform distribution results the draw sequence consisting of 13 draw packs instead of 12. Since is an odd number, this draw sequence is unpairable—the subtournament needs at least one outer draw.

In document Table of Contents (Pldal 85-91)