Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Joins, unions to determine matched pairs
Message
De
09/03/2003 21:11:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
09/03/2003 20:59:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00763478
Message ID:
00763485
Vues:
18
>Hi Hilmar,
>I will start to think about the problem as you suggested. Please continue to work on it. I will keep you posted on my progress. Please keep me posted on your progress.

I can't dedicate much time to this right now, but I am available for any specific questions.

Do you know how program recursive functions? If not, my article in UT Magazine can give you an introduction.

It also occurs to me that, as a shortcut, you keep track of what number combinations are missing. Then, you seek the letter combination that covers the greatest part of the missing combinations. Example (I will use single numbers instead of letter pairs - 'tis the same principle):

You need to cover options:

1 2 3 4 5 6 7 8 9 10

Letter "a" covers options 2 4 6. Let's say your program already decided to use letter "a".

Options still missing: 1 3 5 7 8 9 10

Now, letter b covers options: 1 2 3 (this includes two of the missing options).

And letter c covers options: 5 8 10 (this includes three of the missing options).

You select letter c, and continue the algorithm.

Note: This shortcut should be much faster than the recursion proposed previously - but I believe there is no guarantee that it will always find the most optimal solution. On the other hand, the recursive solution might run for years, or centuries, on large data sets.

Another note: Neither of these algorithms can be solved with simple SQL statements. You will have to program loops.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform