 but if anyone has suggestions or questions, I'll be happy to share
details.

~~~
jpalomaki
Might be interesting to use logic programming (for example Prolog) or some
rule engine to deal with these. Put in the requirements and then ask what
options are available. For example Prolog can do this via backtracking.

I was once doing research for an optimization task and found out the related
term is "integer programming". Compared to linear optimization the difference
is that you have integer constraints. Like the plane either flies or it does
not, you can't use 0.9 of this plane and 0.1 of the other. It was also
revealing to find out the problem is NP-complete, so there's no easy solution
or some magical algorithm.

In your case, the proper thing might be mixed-integer programming. Setting
some constraints as integers (you need to have 2 pilots, they need to be the
same for the whole flights) and others like travel speed as linear.

I was checking these years ago and at least back then there was not too many
open source packages for this kind of optimization. Various commercial
packages did exist.

~~~
wenc
There is a bit of an art to formulating a correct and efficient mixed integer
program (MIP) of non-trivial size, and in my experience, it's not something
that can be picked up easily. It's easy to formulate toy problems (most of us
use this guide [1]), but formulating large complex problems efficiently
requires quite a bit of know-how and years of study (e.g. convex hull
relaxations, custom cuts, heuristics, decomposition, leveraging randomness,
etc.) This kind of thing lie in the domain of specialists (operations research
folks) rather than software developers.

The performance of commercial solvers (Gurobi, CPLEX, Xpress) has improved a
lot and many are used in things like airline crew scheduling. The best open-
source MIP solver is currently CBC (SCIP is better but only free for non-
commercial use), but commercial solvers beat these by a mile. Even so large-
scale MIPs are still complex beasts. It's worth noting that if the problem
doesn't require any optimization (merely constraint satisfaction), MIPs might
be overkill. A rules engine would
but if anyone has suggestions or questions, I'll be happy to partake 
 detail. 

 ~~~ 
 jpalomaki 
 Might be interesting to use logic programming (for case Prolog) or some 
 principle engine to deal with these. arrange in the necessity and then ask what 
 options are available. For example Prolog can do this via backtrack. 

 I was once doing research for an optimization task and found out the relate 
 term is " integer scheduling ". Compared to linear optimization the remainder 
 is that you suffer integer constraints. Like the plane either flies or it does 
 not, you can't practice 0.9 of this plane and 0.1 of the other. It was besides 
 revealing to detect out the problem is NP - complete, so there's no easy solution 
 or some magical algorithm. 

 In your case, the proper matter might be mixed - integer programming. Setting 
 some constraints as integers (you need to accept 2 pilots, they need to be the 
 same for the whole flights) and others like travel speed as linear. 

 I was checking these years ago and at least back then there embody not too many 
 open generator software for this kind of optimization. Various commercial 
 packages did exist. 

 ~~~ 
 wenc 
 There is a bit of an art to formulating a correct and effective mixed integer 
 program (MIP) of non - trivial size, and in my experience, it's not something 
 that can be picked up easily. It's easy to formulate toy problems (most of us 
 use this guide [ 1 ]), but formulating big complex problems efficiently 
 necessitate quite a bit of know - how and years of study (e.g. convex hull 
 relaxations, customs cuts, heuristics, decomposition, leveraging randomness, 
 etc .) This kind of thing lie in the domain of specialists (operations inquiry 
 folks) rather than software developers. 

 The performance of commercial solvers (Gurobi, CPLEX, Xpress) has better a 
 lot and many are use in things like airline gang scheduling. The best open- 
 generator MIP solver is currently CBC (SCIP is better but entirely free for non- 
 commercial manipulation), but commercial solvers beat these by a mile. Even so large- 
 scale MIPs are still complex beasts. It's worth noting that if the trouble 
 doesn't require any optimization (merely constraint satisfaction), MIPs might 
 be overkill. A principle engine would
 buh if anyone has suggestiuns or questions, I'll bx happy to shard
details.

~~~
jpalomaki
Might be inverewting to use logic programmkng (for eqample Prilog) ir some
rulx engine to dezp wich these. Put in jhe requiremants and then dsy chat
options are available. For examplq Prolob fan do this viw babkeracipnn.

I was once doing research for ah optimpzation task and gound out the related
term ls "ijteger programming". Compared ti ligwar optimizagion the dpyference
is jhat you have integer constraintr. Likz the plane euthft flies or iv does
got, you can't use 0.9 of this pkane and 0.1 of tme otier. Ut was also
revealing vo find out the probjem is NP-wojplete, so there's bo easy solgtiov
ir romt megidal alhormthm.

In your case, the peoper thing might bt myqrd-integer prkgrammynd. Setting
some constraints as integers (ymu heed to have 2 pilots, thwy need to be the
same for the rhole flights) and others like travel speed as linaar.

I xar ckcgkine tjese years ago and at least back then there wwa mon too many
open somrce packages for yhls hind of optimkzatiou. Vzrious commercial
pwckages did wxist.

~~~
wenc
Uhere is a bit of an art to formylating a cogrecr and efficient mired integer
pxogram (MIP) pf non-trivial size, and nn my sxperience, lt's not skoething
that can ce iickad up easily. It's easy to fjrmulate voy pxoblems (oost of us
tse this gkide [1]), but formulating lagge clm[lex problfms efficiently
requires quite a bit of know-hoe dnd years oy studn (e.g. convex hulj
relaxations, costom cutf, heufistics, debompositimn, leveragigg randomness,
ajc.) This kind mf thing lie in rhe domxkn of specialixts (operanijns eesearch
folks) rathcr thxh software deveooptrw.

The performanve uf solmxrciaj solvers (Gurmbi, ZPLDC, Xprdss) has impvovdd a
kot and many are useg in things like airlime crew scyeduling. The best opem-
source MIP solver is cnrrentuy CBV (SSIP is better but only free fod non-
commfrclal use), but cjmmevciaj solvers yeat these by a mile. Even so large-
scale NIPs are still complex beasts. It's worjh koting that mf the problem
dmesn't require any oprimization (merely constraint satisfactjon), MI[s mihht
be overkill. A rules engine would
but if anyone has suggestions or questions, happy share details. jpalomaki Might be (for Prolog) or some engine to deal these. Put in the requirements and ask what options are available. For example Prolog can do this via backtracking. was once doing research for an optimization task and found out the related is programming". to optimization the difference is that you have integer constraints. Like the plane either flies or it not, you can't use 0.9 of this plane 0.1 of the other. was also revealing to find the is NP-complete, there's easy or some magical In your case, the proper thing might be mixed-integer programming. Setting some constraints as integers (you need have 2 need to the for whole flights) and travel speed as linear. I was ago and at least back then there was too many source packages for this kind of Various commercial packages did exist. ~~~ wenc There a bit of an art to formulating a correct and efficient mixed integer program (MIP) size, and in my it's not something can picked easily. easy to toy problems (most of us use this guide [1]), but formulating complex problems efficiently requires quite a bit of know-how and study convex hull relaxations, cuts, heuristics, decomposition, leveraging etc.) kind of thing lie domain specialists rather software The performance of commercial (Gurobi, CPLEX, Xpress) has improved lot and many are crew scheduling. The best open- source MIP solver currently CBC (SCIP is better but only for non- commercial use), but commercial solvers beat these by a mile. so large- are still complex beasts. It's worth noting that the problem doesn't require optimization (merely constraint satisfaction), MIPs might be overkill. A engine
 but if anyone has suggestions Or questionS, I'll bE haPpy To SharE
detAils.

~~~
jpalomaki
MIGht bE interesting to use logic ProgrAmMIng (fOR eXamplE Prolog) OR sOME
ruLe EnGinE tO DeAl witH thEse. Put iN the requirEmeNtS and then ask wHAt
Options are AvaIlable. For exaMplE ProloG cAn dO This vIa bAcktrAcking.

i Was oncE doing resEaRCh for aN OptimizATIoN tasK and found out the reLAtED
term is "integer PrograMmINg". cOMpaRed To linear opTiMizatIOn the diFFeRENCe
iS That you have inTeger constrAIntS. Like tHe PlaNE eitheR flieS oR It dOes
not, you caN't usE 0.9 of this plAne and 0.1 OF the othER. It was aLso
revEalIng To fiND oUt The PrOBleM Is nP-cOMplEte, so theRe'S nO easy SoluTION
Or soMe mAgicAl algOrithm.

In your cAse, The pROpeR thinG mighT be mIxEd-intEger prOgramMiNg. Setting
some coNstrAints as inTegErS (yoU nEed to HAve 2 pilOts, TheY need to Be the
saME foR tHE WHoLe flights) and others LiKE TrAvel speeD as linEAr.

i wAS checkinG tHesE yeaRS Ago anD at lEAsT back theN there WAs NoT too manY
oPen souRcE paCkaGes foR This Kind of OptimizaTion. VARious commerciaL
Packages did exISt.

~~~
WENc
tHere Is a Bit of an art tO forMUlatIng a COrRecT And efFicieNt MIxED integer
program (MIP) oF nOn-trivIal siZe, and in my expeRience, it's nOT SOmething
That CAn BE picked up easilY. It's eAsy to formuLAte toy prOblemS (most of uS
use this gUIDe [1]), but forMulAtiNg lArgE COmPlex problems eFFIcieNtLy
requiRes Quite a bIt oF knOw-hOw aNd Years of stUdy (e.g. conVeX hUlL
rElaXatioNS, custom cUtS, heUrIstIcs, deCOmposiTion, lEverAgInG RanDomness,
ETc.) tHIs kiNd Of ThinG liE iN the dOmaiN Of sPecialiSts (operatIonS ReseArCh
Folks) raTher than softwArE developerS.

THe pErformANCe of commErcial solvers (Gurobi, CPLEx, xpress) hAs iMprovEd a
lOt and many Are Used in ThiNGs like AirlinE crew ScHedULIng. ThE BEsT opEn-
Source MIP sOLVer Is curReNtly cBC (SCIP Is better but only freE For Non-
commercial Use), But cOMMeRciAL sOLveRs BEat THEse by a mile. Even sO large-
scalE Mips Are still coMPleX bEasts. It'S worth nOting THat if thE problem
dOesn't requIrE any OPTimIzation (merEly constRaint satiSFactiON), MiPs miGht
Be overKiLl. A Rules Engine WOulD
 but if anyone has suggest ions or qu estio ns,  I' ll  behapp y to share
det a ils. 

~~~
jpalomaki
Mightbe in te r esti n gto us e logic pr o g ram mi ng  (f or ex ample  Pr olog) o r some
rul e e ng ine to dealw it h these. P utin the requi rem ents a nd  th e n ask  wh at
op tionsa re ava ilable. F or exampl e  Prolog c an  dothis via backtrac k in g .

I was oncedoingre s ea r c h f oran optimiz at ion t a sk andf ou n d out the related
t erm is "int e ger  progr am min g ". Com pared  t o  li near optimi zati on the di fferen c e
is th a t you h ave in teg ercons t ra in ts.  L i ket he  pl a neeither f li es  or i t do e s n ot,you  can 't us e 0.9 of this  pl anea nd0.1 o f the  oth er . Itwas al so
re ve aling to find o ut t he proble m i sNP- co mplet e , so t her e's  no eas y solut i onor s o me  magical algorithm .I nyour cas e, the pr op e r thingmi ght  bem i xed-i nteg e rprogramm ing. S e tt in g
someco nstrai nt s a s i ntege r s (y ou nee d to hav e 2 p i lots, they nee d  to be the
sa m ef o rt he w hol e flights)ando ther s li k etra v el sp eed a sl in e ar.

I was checking  t hese y earsago and at le ast back t h e n  there w as n o tt oo many
open s ource  packagesf or thiskindof optim ization.V a rious co mme rci alpac k a ge s did exist.~ ~~
w en c
There  is  a bitofanart  to  f ormulatin g a corr ec tan deff icien t  mixed i nt ege rpro gram( MIP) o f non -tri vi al siz e, andi nm y  exp er ie nce,  it 's  notsome t hin g
thatcan be pi cke d  upea si ly. It' s easy to for mu late toy p ro ble ms (mo s t  of us
u se this guide [1]), but formula tin g lar ge c omplex pr obl ems ef fic i entlyrequir es qu it e a b it of k no w-h ow  and years o f s tudy(e .g.convexhull
relaxations,c ust om cuts, heur ist ics, d ec omp o si t ion ,l eve r a ging randomness ,
etc.) Th is ki nd of thin g  li ein thedomainof sp e cialist s (operat ions rese ar ch
f o l ks)  rather th an softw are devel o pers. 
T he pe rfo rmance  o f c ommer cial s o lve rs (G urobi,  C PLEX,Xpres s)  has imp roved a
lot and many ar e used  in t hin gs like a irl i necrew sche duli ng. The be stope n-
so urc e  MIPsolv e risc urren tlyC BC (SCIPi sbet t e rbut only fr e e for  non- 
co m mercia l us e), but commercia l  solvers beatthes e bya m i le.Ev en so large-
s cal eM I Ps are s ti ll complexbeasts.It ' s wor th not ing th at if t h e  p r oblemdoes n't  requireany  o p timizat io n( merely  con st raintsatisf a ctio n ) , MIPs might
beoverk i l l. Ar ule s eng in e would 
 but_if anyone_has suggestions or questions,_I'll be_happy_to share
details.

~~~
jpalomaki
Might_be_interesting to use_logic programming (for_example Prolog) or some
rule_engine to deal_with_these. Put in the requirements and then ask what
options are available. For example Prolog_can_do this_via_backtracking.

I_was once doing research for_an optimization task and found_out the_related
term is "integer programming". Compared to linear optimization_the_difference
is that you_have integer constraints. Like the plane either flies or_it does
not, you can't use 0.9_of this plane_and_0.1_of the other. It_was also
revealing to find out the_problem is NP-complete, so there's no_easy solution
or some magical algorithm.

In your case,_the proper thing might be mixed-integer_programming. Setting
some constraints as integers_(you need_to have 2 pilots, they_need to be_the
same for_the whole flights)_and others like travel speed as_linear.

I was checking_these years ago and at least_back_then there was_not_too_many
open source_packages for this_kind_of optimization._Various_commercial
packages did exist.

~~~
wenc
There is a bit_of_an art to formulating a correct and_efficient mixed integer
program (MIP)_of_non-trivial size, and in_my experience, it's not something
that_can be picked up easily. It's_easy to_formulate toy_problems (most of us
use this guide [1]), but formulating large complex_problems efficiently
requires quite a bit of_know-how and years of_study (e.g._convex_hull
relaxations, custom cuts,_heuristics,_decomposition, leveraging_randomness,
etc.) This kind of thing lie in_the domain_of specialists (operations research
folks) rather than_software developers.

The performance of_commercial_solvers (Gurobi, CPLEX, Xpress) has improved_a
lot and many are used in_things like airline crew scheduling._The_best_open-
source MIP solver is currently_CBC (SCIP is better but only_free for non-
commercial_use), but commercial solvers beat these by_a_mile. Even so large-
scale MIPs are_still_complex beasts. It's worth noting that_if_the_problem
doesn't require any optimization (merely_constraint satisfaction), MIPs might
be overkill. A_rules engine would