Navigation: Jump to content areas:


Pro Quality. Fan Perspective.
Login-facebook
Around SBN: The Most Dangerous Division in Sports

Optimal VDS Team - Hardcore (Here be Math)


VDS for Math Nuts

This is going to be a funky post about maximizing VDS teams. It is going to delve into esoteric programming techniques and show how the VDS system is an example of a generally hard problem. Here there be equations. No apologies. You can skip to the end to see the results. Amazingly Open Office and Excel have just the tools we need to solve these. We do live in days of miracle and wonder!

Star-divide

I drive up to Stevens Point Wisconsin in December to run in the Frostbite race there with a bunch of teachers (retired as they now always point out). Every year is a different kind of year with that type. One year was the "math is everywhere" year. This is one example.

What is the problem? Well we want to answer questions like
What is the best possible VDS team right now?
How about that with Contador?
What about if I had had Andy Schleck, what is the best I could be doing?

and questions like that. It looks simple but it isn't. To get the feel, at every rider point change there is a new sub-problem if you will, say we go from Alberto Contador to Phillip Gilbert. That is a 4 point cost difference. So we have to figure out if PG + the best 122 point 24 rider team beats AC + best 118 point 24 rider team.

Ok here we are diving in to the math hard ...
This is called a Linear Programming problem. An Integer Linear programming problem in fact. Even more it is a Boolean Integer Programming problem. Here is what it looks like.

There are  961 possible riders or variables if you will.

For each rider we have a cost in points. Lets list from highest cost to lowest cost riders. There are 10 costing between 24-32 points, 11 between 18-22 points. So we will have three things for each rider on the list: a Cost, call it C_n for the n'th rider on the list. A Point Total, call it P_n for the n'th rider on the list, and a variable that is either 1 if the rider is on the team or 0 if he is not on the team. Call this x_n for the nth rider on the list. Hey! We are finally able to actually state our problem now:

We want to maximize the points. That is, the sum of the P_n * x_n over all n from 1 to 961.
semi-symbolically the Max of

961
SUM x_n * P_n
n=1

subject to the following constraints:

The sum of all the x_n's has to be less than equal to 25:
961
SUM x_n = 25
n=1

The sum of the costs of the selected riders (C_n * x_n) has to be less than or equal 150
961
SUM x_n * C_n <= 150
n=1

If we sort from highest cost to lowest then the sum of the first 10 most costly riders has to be 1. That is we can only have 1 selection from the top 10 riders (24 and above cost)
10
SUM x_n <= 1
n=1

We can only have three riders from the most costly 21 (those with cost 18 and up).
21
SUM x_n <= 3
n=1

There you go, a wonderful Integer programming problem in 961 variables. Actually it is a very interesting problem. Looked at naively it seem impossible because of the number of combinations. But really this is where a technique called dynamic programming comes into play. This is a divide and conquer thing. Look at it this way. The best 4 point cost team is either the best 3 point and best 1 point of those left, or the two best 2 point teams (or the best 1 point team and then the best 3 point team left. The 1-3 cases are the same but the margin is too small ...) At every point cost level this is true so you only really need to evaluate a logarithmic function of the total number of possible team combinations. And there are nice pruning methods to use too. So overall you only need a few 10's of millions of comparisons. That is a snap with a modern computer.

Both Excel and Open Office calc have decent "Solver" modules.

So as of right as I post after stage 1 Romandie, the best possible team is

Philippe Gilbert
Tom Boonen
Joaquin Rodriguez Oliver
Oscar Freire Gomez
Luca Paolini
Juan Antonio Flecha
Ryder Hesjedal
Maxim Iglinskiy
Björn Leukemans
Chris Horner
Roger Hammond
Bernhard Eisel
George Hincapie
Paul Martens
David Millar
Bert De Waele
Igor Anton Hernandez
Enrico Gasparotto
Theo Bos
Jens Keukeleire
Sacha Modolo
Bobbie Traksel
Sep Vanmarcke
Peter Sagan
Francesco Ginanni

With 12262 points

Best team with Alberto Contador is

Alberto Contador Velasco
Tom Boonen
Joaquin Rodriguez Oliver
Oscar Freire Gomez
Luca Paolini
Juan Antonio Flecha
Ryder Hesjedal
Maxim Iglinskiy
Björn Leukemans
Chris Horner
Roger Hammond
Bernhard Eisel
George Hincapie
Paul Martens
David Millar
Igor Anton Hernandez
Enrico Gasparotto
Jens Keukeleire
Sacha Modolo
Bobbie Traksel
Sep Vanmarcke
Peter Sagan
Francesco Ginanni
Beñat Intxausti Elorriaga
Kris Boeckmans

with 11755 points and I could go on with others. These are NOT necessarily unique. There could be others with the same point total. I have the spreadsheet (Open Office version) which I will make available somewhere with explanation. If you any any particular questions I could see if I can get an answer and give it. It looks like there are other people here who can also run these.

Comment 55 comments  |  5 recs  | 

Do you like this story?

Comments

Display:

Nice!

Thanks for putting the time and effort into that. Very interesting.

I, for one, would be interested in seeing the spreadsheet if you don’t mind uploading it somewhere.

Mark

by mpw5 on Apr 28, 2010 2:46 PM EDT reply actions  

Uh-oh

Watch out for the cats tomorrow morning.

Staring at the swim team gets you killed by a gang of dancing ninja men who know how to twirl.

by TheFigurehead on Apr 28, 2010 3:23 PM EDT up reply actions  

Is that a problem?

Staring at the swim team gets you killed by a gang of dancing ninja men who know how to twirl.

by TheFigurehead on Apr 29, 2010 6:13 AM EDT up reply actions  

Integer programming...

…haven’t done that in a while. Might be fun to code this up in GAMS.

by rawls on Apr 28, 2010 3:25 PM EDT reply actions  

Thanks!

(one slight adjustment: x_n must be exactly 25)

by tedvdw on Apr 28, 2010 4:09 PM EDT reply actions  

Wait,

surely it has an effect on the optimisation algorithm, because of the 150 point team cost constraint?

by tedvdw on Apr 28, 2010 4:33 PM EDT up reply actions  

Will be done.

It is just in the description of the constraints since you have to enter those anyway.

by Markk on Apr 28, 2010 4:39 PM EDT up reply actions  

To get the spreadsheet link

To get the vdsriders-0428.ods spreadsheet go to
public.me.com/kaehny and download the file. There is a whole sheet with explanation and you will have to set up the solver page – it is lost on saving, an ods bug. Excel is probably easier but I don’t have a copy.

You can add all sorts of funky constraints to get see interesting combinations.

by Markk on Apr 28, 2010 4:32 PM EDT reply actions  

Why don’t you just save the file as .xls?

by Ryan_Liles on May 1, 2010 3:42 AM EDT up reply actions  

It's not an excel file

The solver is different. Actually OO has LP Solve which is a great linear optimization solver, but the interface is nigh useless as is, since you can’t save the constraints. I don’t have Excel, so if someone wants to build it there and send it to me I’ll put it up.

by Markk on May 1, 2010 4:54 PM EDT up reply actions  

Why are numbers beautiful?

Why are numbers beautiful? It’s like asking why is Beethoven’s Ninth Symphony beautiful. If you don’t see why, someone can’t tell you. I know numbers are beautiful. If they aren’t beautiful, nothing is - Paul Erdös

Bunch of slack-jawed faggots around here. This stuff will make you a god damned sexual Tyrannosaurus, just like me - Jens Voigt, Predator (1987)

by tenchu on Apr 28, 2010 4:42 PM EDT reply actions  

Very cool

Thanks Markk

"Do you think we are a bunch a girls?...Go and ride some cobbles and you’ll definately know that we don’t discuss perfume and shaving cream." - Dom

by Jimbo... on Apr 28, 2010 5:32 PM EDT reply actions  

Love seeing you use(d) openoffice...

(i work"ed" for the company that once brought you openoffice…and am now adjusting to life under the new world order…)

by JustJoshinYa on Apr 28, 2010 5:37 PM EDT reply actions  

Star Office?

I remember downloading that thing over dialup a few years back. The biggest thing I’d ever downloaded then.

by Monty. on Apr 28, 2010 5:58 PM EDT up reply actions  

the latest internal one is pretty big too...

can’t recall the exact size but it took awhile over vpn to download. So far I can’t tell many differences (’cept badging and some color/font changes), but who knows…

by JustJoshinYa on Apr 28, 2010 6:10 PM EDT up reply actions  

Barbie is so f*cking right about that.

I want to take this opportunity to mention that no math was used in the compilation of either of my kick-ass teams.

by ELVISGOAT on Apr 28, 2010 7:59 PM EDT up reply actions  

So...I think part of my brain went into meltdown looking at that.

I agree with Barbie’s statement.

Tommeke!, Tommeke!, Tommeke!, Tommeke!

by Vlaanderen90 on Apr 28, 2010 6:18 PM EDT reply actions  

Wicked!

Math is the ultimate language. I wish I could speak that language too.

"It's a lovely thing, feeling that momentum. If you're lucky, it's also about grace." Tim Winton

by sminer on Apr 28, 2010 9:59 PM EDT reply actions  

Math

can go eat shit and I shall now cry because my head hurts that bad. But well done even though I am 99% sure it was not in English.

Quitter's People United member # 42

by Phil H. on Apr 28, 2010 10:21 PM EDT reply actions  

Math wins again

My 8 year old daughter made a VDS team as a math problem. I showed her the rules and she made 25 riders = 150 points. She had two questions: Who’s the best rider? I said Contador, she said I want him. Is Jens! on here? She loved the “more is better” video. Anyway, she’s in the upper 25% scoring wise. Goes without saying she’s doing much better than I am.

by sebastiandeluded on Apr 28, 2010 10:35 PM EDT reply actions  

Awesome

I’m getting beaten by an 8 year old girl. Fucking awesome.

"Do you think we are a bunch a girls?...Go and ride some cobbles and you’ll definately know that we don’t discuss perfume and shaving cream." - Dom

by Jimbo... on Apr 29, 2010 3:00 PM EDT up reply actions  

8 year olds dude.

"Ants don’t worry, they operate like a fantastic team, they accept obstacles and deal with them in a positive manner, they don’t complain and remain positive. An ant doesn’t work on emotion, is proactive and always chooses the ant role."

by ant1 on Apr 29, 2010 4:37 PM EDT up reply actions  

amazing

long time no see “Boolean” hehe

"I though, I’d better let this motorbike come by but when I turned around and looked it was Cancellara," - Bernhard Eisel

by perezbike on Apr 29, 2010 1:20 AM EDT reply actions  

WOW

this is great!
LOVE it.

by rbjhan on Apr 29, 2010 5:50 AM EDT reply actions  

I can do it using Excel and solver - which can do almost anything

But someone with a really big brain could presumably write a mathematical equation to solve it without computers? Is that true?

by addict on Apr 29, 2010 7:08 AM EDT reply actions  

But big brains are more sexy..

"How strange it was to see men doing something beautiful. Something pointless and elegant." Tim Winton, 'Breath'

by Seahorse on Apr 29, 2010 9:15 AM EDT up reply actions  

once again we see that size really does matter.

but then anything is more sexy than a spreadsheet

by yeehoo on Apr 29, 2010 1:02 PM EDT up reply actions  

Are you allowed to use VB

to conjure up a hidden Excel sheet, solve it and then add a few bouncing icons?

by Monty. on Apr 29, 2010 2:17 PM EDT up reply actions  

bouncing

now we’re getting somewhere

by yeehoo on Apr 29, 2010 3:19 PM EDT up reply actions  

In Taiwan, bouncing icons are practically required in office documents.

by Ryan_Liles on May 1, 2010 3:44 AM EDT up reply actions  

might try running this on last year's results

interesting to see how the optimal team based on this year’s costs and constraints but last year’s points is doing this year

by thebongolian on Apr 29, 2010 8:15 AM EDT reply actions  

so I did this

which means if we’d been using this year’s prices and rules last year the best team you could have generated for the year was this (assuming I haven’t cocked this up):

Alejandro Valverde Belmonte………. 2408
Bert Grabsch …………………………………..332
Danny Pate……………………………………..155
Denis Menchov……………………………….1610
Frantisek Rabon……………………………..370
Gregory Henderson………………………..280
Ignatas Konovalovas………………………305
Johan Vansummeren……………………..285
Karsten Kroon…………………………………590
Koldo Fernandez De Larrea…………..280
Leif Hoste……………………………………….280
Leonardo Bertagnolli……………………..285
Manuel Quinziato…………………………..285
Martin Elmiger………………………………..305
Martin Pedersen…………………………….150
Paolo Tiralongo……………………………..295
Ruben Plaza Molina………………………285
Sylwester Szmyd……………………………140
Tadej Valjavec……………………………….330
Tom Boonen………………………………….1525
Vladimir Karpets…………………………….410
Yauheni Hutarovich……………………….345

Total……………………………………………….11250

Not a terribly good result – would have put you 91st overall.

But what would with it have got you so far this year? 3104 or 103rd in the rankings – not bad (and far better than I’m doing) but not really challenging for the top. Also not got great promises for huge amount of further points unless Denis Menchov wins another GT, Valv.Piti avoids the banhammer and Tommeke gets green in July which seems unlikely all to happen.

So perhaps not a good basis for choosing next year’s team…

by thebongolian on Apr 29, 2010 4:34 PM EDT up reply actions  

i have none of those riders.

hopefully that’s a good thing.

"Ants don’t worry, they operate like a fantastic team, they accept obstacles and deal with them in a positive manner, they don’t complain and remain positive. An ant doesn’t work on emotion, is proactive and always chooses the ant role."

by ant1 on Apr 29, 2010 4:39 PM EDT up reply actions  

I'd like to propose

That the Lantern Rouge be allowed to swap teams with the one above.

Jens Voigt doesn’t know where you live, but he knows exactly where you will die.

by OnTheRivet on Apr 29, 2010 12:05 PM EDT reply actions  

Bah ;)

The spreadsheet solver function is depressingly quick. It takes just a few tenths of a second to get the optimal team roster, using OpenOffice on my computer.

I’ve been struggling to implement some sort of solver into a simple algorithm. I’ve done a Monte Carlo version which was fairly straightforward and comes within 5% of the maximum points quite quickly (a few seconds, while it only checks 2 parameters before randomly swapping riders between team & pool) but is has trouble homing in on the optimum within a reasonable time (not within minutes).

Could anybody point me towards a way of iteratively generating all bitfields of a certain width and a fixed amount of 1’s and 0’s? Related to the binomial coefficient (n, k) = n! / (k! (n-k)!).

by tedvdw on May 1, 2010 2:39 PM EDT reply actions  

Thats easy, but in what language, etc.

Doing that is pretty useless for any large bitmap of course. The fastest way for up to 32 bits is just likely to be incrementing an unsigned integer, then just check. Computers are amazing fast at simple integer and logical code like that. A fast way to check would be generate a 256 number long array with values for each byte and just do a byte lookup.

The solver in the spreadsheet is doing the real simplex or even better opimization.. Monte Carlo is fun though. Wow I got to use more jargon in this reply than about 1 year of email!

by Markk on May 1, 2010 5:01 PM EDT up reply actions  

Creating the data structure is easy, the language is immaterial

but how to economically generate the permutations without going through every possible configuration is not immediately obvious to me. I’m talking about 25 1-bits in a 150 or so wide bitfield: the team selector, just like the Member column in your spreadsheet.

by tedvdw on May 1, 2010 5:10 PM EDT up reply actions  

Hah? 25 1's in 151 choices?

That is a 150 choose 25 long list. Let’s just say that the number of atoms in the Solar System can’t contain that list. You do NOT want enumerate that list ever. I can write a generator in minutes it will take millennia if not longer to get anywhere in the list.
It is way bigger than listing all possible shuffles of card deck for example.

by Markk on May 2, 2010 7:19 PM EDT up reply actions  

Hey here's a question for all you maths geeks.

I was trying to come up with a good way of expressing the relative value of riders based on their costs. Efficiency is a good one but it lacks something. The best riders have lower efficiencies than inexpensive ones. The best riders are however better and will be very useful in generating a competitive team.

I am thinking of something relating to the idea of return of invested capital. I tried to do % of points spent divided by % of x with x being a competitive score (like 13000 points) but It ended up producing a kind of bell curve with high cost riders (who produced a large number of points)and low cost riders (who produced a small number of points) generating similar results while moderately priced riders (producing moderate results) did not generate similar numbers.

I am poor at complex maths, I last studied maths in high school and have used no real maths since. Unless you count addition and subtraction and using calculators to figure everything else out. I think this would be helpful at finding quality riders at various levels.

Oh well here’s to hoping some one with strong Math-Fu will be able to succeed where I fail.

'When playing a game, the goal is to win, but it is the goal that is important, not the winning' - Dr. Reiner Knizia

by bought with blood on May 5, 2010 2:58 PM EDT reply actions  

not sure there's a perfect metric

as the discussion on an optimal VDS shows what matters is not just how many points that rider scores but which other riders and their points you lose by selecting him given you have 25 riders, 150 points etc

so short of doing the optimal VDS team I think anything you invest will have some kind of flaw

that said something that involves raising the points scored to a power could reflect the benefit of higher cost riders who score with a similar efficiency to 1 or 2 pointers – if we call this the X factor, it might be expressed as:

X = (rider score ^ k) / rider cost

You then get into what value k should have and I reckon something around 1.2 would probably be right – I’ll try and run this through a spreadsheet later

by thebongolian on May 5, 2010 5:02 PM EDT up reply actions  

I did something similar

Points scored / (Cost ^ k) where k is less than 1, and by purely arbitrary tweaking until I got some results I liked I found that k=.3 seems pretty reasonable

Alejandro Valverde 25 916.80
Philippe Gilbert 16 866.20
Heinrich Haussler 2 865.05
Andre Greipel 2 856.93
Alberto Contador 25 845.98
Samuel Sanchez Gonzalez 14 783.80
Simon Gerrans 2 731.03
Cadel Evans 25 726.43
Tyler Farrar 4 719.13
Denis Menchov 16 700.79
Edvald Boasson Hagen 6 689.93
Mark Cavendish 20 687.17
Thor Hushovd 16 679.03
Serguei Ivanov 2 674.17
Fabian Cancellara 25 657.52
Andy Schleck 16 638.55
Tom Boonen 20 620.81
Tony Martin 4 600.38
Stefano Garzelli 4 593.78
Johnny Hoogerland 1 570.00

Some might prefer k = .2

Alejandro Valverde 25 1264.94
Alberto Contador 25 1167.23
Philippe Gilbert 16 1142.95
Samuel Sanchez Gonzalez 14 1020.52
Cadel Evans 25 1002.28
Mark Cavendish 20 927.19
Heinrich Haussler 2 927.14
Denis Menchov 16 924.70
Andre Greipel 2 918.43
Fabian Cancellara 25 907.20
Thor Hushovd 16 895.98
Andy Schleck 16 842.57
Tom Boonen 20 837.65
Tyler Farrar 4 826.07
Edvald Boasson Hagen 6 825.31
Simon Gerrans 2 783.50
Serguei Ivanov 2 722.56
Filippo Pozzato 14 716.72
Robert Gesink 16 709.32
Tony Martin 4 689.65

by Monty. on May 6, 2010 2:13 AM EDT up reply actions  

Comments For This Post Are Closed


User Tools

Every sprint, every cobble, every mountain pass from the world of Pro Cycling

Giro d'Italia Podium Cafe

Celebrate the Giro d'Italia at Podium Cafe!

Check our Giro Section for race updates, on-the-scene reports, and other hijinx.

FanShots

Quick hits of video, photos, quotes, chats, links and lists that you find around the web.

Recent FanShots

Dave Zabriskie wins his 53rd consecutive US TT championship.  full post to follow.
Roads? Where we're going, we don't need roads
Marianne Vos tweets her collarbone x-ray!

She crashed yesterday in the Holland Hills Valkernberg Classic when a race moto got in her way (see more in the story) - but it's so very Vos-like to show us the result.  Heal-fast, Marianne!

(Photo via Vos' twitter and also on VeloNation)
cyclists - it's your fault if you get hit by a car
not quite in Dario Frigo's league . . .
Talking about women's cycling
pdc national champs ride sunday in greenville sc
Trivia time: 
1 Where's the picture shot?
2 Who's the dude riding the race bike?
3 Who's the girl riding the omafiets?

Waaay too easy for this crowd, I know.
Picture by Nieke 0562
Should I, shouldn't I? Or am I being an idiot?
Lee Rodgers Diary: A Memorable Day in Kuala Lumpur

+ New FanShot All FanShots >


Editors

Farrar_and_cafe_small Chris Fontecchio

Espresso_cup_small Jen See