# Tennis Lineup Optimizer

**URL:** <https://discourse.julialang.org/t/tennis-lineup-optimizer/46036>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [September 4, 2020, 3:54am UTC](https://discourse.julialang.org/t/tennis-lineup-optimizer/46036 "2020-09-04T03:54:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cameron\_Taylor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameron_taylor/32/17679_2.png) [@Cameron\_Taylor](https://discourse.julialang.org/u/Cameron_Taylor)\
**Post date:** [September 4, 2020, 3:54am UTC](https://discourse.julialang.org/t/tennis-lineup-optimizer/46036/1 "2020-09-04T03:54:18Z")

</div>

Hi all,

I’m putting together a little tennis lineup optimizer program to play some daily fantasy contests during the US Open here.

I’m trying to write a constraint that picks a set of players on the condition that a player and their opponent cannot both be selected in the same lineup.

The path is a csv file that contains a list of the players, their opponents, and other information related to the contest.

Thank you in advance for any guidance you can provide,

Cam

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [September 4, 2020, 4:21am UTC](https://discourse.julialang.org/t/tennis-lineup-optimizer/46036/2 "2020-09-04T04:21:48Z")

</div>

I assume you are using JuMP?

Take a read of the first post of [Please read: make it easier to help you - #81](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757/81). To get help, you will need to formulate a specific question, and ideally provide simplified code demonstrating what you have tried.

You might be interested in  
[https://github.com/zlisto/Daily-Fantasy-Baseball-Contests-in-DraftKings](https://github.com/zlisto/Daily-Fantasy-Baseball-Contests-in-DraftKings)

---

<div class="post-metadata">

**Author:** ![Cameron\_Taylor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cameron_taylor/32/17679_2.png) [@Cameron\_Taylor](https://discourse.julialang.org/u/Cameron_Taylor)\
**Post date:** [September 4, 2020, 4:03pm UTC](https://discourse.julialang.org/t/tennis-lineup-optimizer/46036/4 "2020-09-04T16:03:31Z")

</div>

Hi Oscar,

Thanks for your reply and helpful links. In fact I am working from the zlisto code you linked to, and after going through the specific bits of code again to share here, I was able to find a workaround to constrain players from being chosen in the same lineups as their opponents.
