Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
74 views25 pages

Open Source in Optimisation: Dr. Stuart Mitchell Department of Engineering Science University of Auckland New Zealand

This document discusses open source optimization software and the use of PuLP, a Python module for mathematical programming. It begins by introducing PuLP and how it allows easy expression of mathematical programs that interface with separate solvers. It then provides examples of using PuLP to model and solve optimization problems, including generating a field frontier problem and a travelling tournament problem. The document advocates for using open source tools in optimization education and research.

Uploaded by

chuchomat87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views25 pages

Open Source in Optimisation: Dr. Stuart Mitchell Department of Engineering Science University of Auckland New Zealand

This document discusses open source optimization software and the use of PuLP, a Python module for mathematical programming. It begins by introducing PuLP and how it allows easy expression of mathematical programs that interface with separate solvers. It then provides examples of using PuLP to model and solve optimization problems, including generating a field frontier problem and a travelling tournament problem. The document advocates for using open source tools in optimization education and research.

Uploaded by

chuchomat87
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

The University of Auckland

Open Source In Optimisation


Dr. Stuart Mitchell Department of Engineering Science University of Auckland Ne !ealand
s.mitchell"auckland.ac.n#

$ontents of presentation
%hat is Open Source &he open source future for O' (u)( *enrating a +ield ,rontier ith (u)( &raveling tournement pro-lem ith (u)( ,urther (u)( e.amples

%hat is open source


/ A term used to descri-e soft are distri-uted in source under licenses guaranteeing any-ody rights to freely use0 modify0 and redistri-ute the code. / E.amples of Open Source soft are include1
2 &he )inu. 3ernel 2 &he Apache %e- Server 2 &he ' (ro4ect for Statistical $omputing 2 Open $miss

Statistical soft are nets technology a ard


/ Otago Daily &imes 55 Nov 6778
'oss Ihaka has on Ne !ealand9s top a ard for technology achievements0 the 6778 (ickering Medal. Dr Ihaka0 of Auckland University0 gained his honour for a package of computer programmes. &he medal as one of series a arded -y the national science academy0 the 'oyal Society0 -efore :87 of the nation9s senior scientists at &e (apa in %ellington0 Dr Ihaka9s soft are for statisticians0 called '0 can -e do nloaded free and has had huge uptake -y universities0 industry and government. 'eadily customised for different applications0 it has proved invalua-le for ma4or ;data crunching; tasks such as processing genomic information.

Statistical soft are nets technology a ard


/ &he package and the paper introducing it have -een cited over 5<77 times in research papers1 the highest 9hit=rate9 for pu-lications in the mathematical sciences over the past 57 years0 orld ide0 and it is no disseminated from over <> internet sites in :7 countries.

&he open source future for O'


/ (resently the $omputational O' tools used0 taught ithin this department0 are closed source.
2 E.cel ?Storm 2 AM()0 *AMS 2 $()E@0 E@('ESS0 !I(

/ Students can not afford commercial licences of this soft are / Students cannot see ho this soft are orks.

&he open source future for O'


/ &hese tools follo development. the 9$athedral9 style of

2 ... soft are .. -uilt like cathedrals0 carefully crafted -y individual i#ards or small -ands of mages orking in splendid isolation0 ith no -eta to -e released -efore its time Eric S. 'aymond

/ &hey are also typically e.pensive for non= academic use

&he open source future for O'


/ Open source tools0 for instance the )inu. 3ernel0 can follo a 9Aa#aar9 development model
2 a great -a--ling -a#aar of differing agendas and approaches out of hich a coherent and sta-le system could seemingly emerge only -y a succession of miracles Eric S 'aymond

&he open source future for O'


/ %hat are the attri-utes of the Aa#aarB
2 (u-licly availa-le code that is released and updated often 2 &he a-ility for anyone to make improvements 2 A community that pushes for constant improvement and code Cuality

&he open source future for O'


/ %hat are the attri-utes of the Aa#aarB
2 (u-lication1
/ (u-licly availa-le code that is released and updated often

2 $olla-oration
/ &he a-ility for anyone to make improvements

2 (eer 'evie 1
/ A community that pushes for constant improvement and code Cuality

&he open source future for O'


/ Open source therefore naturally complements the research and pu-lication process. / ,rom the $oin=O' e-site
%hy for O'B $onsider the follo ing scenario. +ou read a-out an optimi#ation algorithm in the literature and you get an idea on ho to improve it. &oday0 testing your ne idea typically reCuires re=implementing Dand re= de-ugging and re=testingE the original algorithm. Often0 clever implementation details aren9t pu-lished. It can -e difficult to replicate reported performance. No imagine the scenario if the original algorithm as pu-licly availa-le in a community repository. %eeks of re=implementing ould no longer -e reCuired. +ou ould simply check out a copy of it for yourself and modify it. Imagine the productivity gains from soft are reuseF

&he open source future for O'


/ Outcomes for students
2 A-ility to access free Dno costE soft are to implement their o n solutions once they graduate 2 A-ility to access free DopenE source code to see ho the algorithms are implemented.
/ Imagine the difference to :G5BB

2 &he a-ility to improve the soft are they use.

(u)(
/ (u)( is a python module that allo s the easy e.pression of Mathematical (rograms / (u)( is -uilt to interface ith separate solvers / (u)( is similar in style to1
2 AM() 2 *AMS 2 O() 2 )IN*O 2 ,)O($HH etc.

(u)(
/ %hy (ythonB
2 $ore (ython synta. leads to the concise statement of M(9s 2 (ython is a scripting language so no compilation is needed and the code is platform independent 2 (ython interfaces easily ith e.ternal solvers that do the heavy lifting 2 (ython comes ith 9-atteries included9
/ &he (ython standard li-rary is huge

(u)(
/ %ritten initially -y I. S. 'oy / No maintained -y S. A. Mitchell / It is availa-le at http1??pulp=or.google=code.com / No availa-le for %indo s and )inu.

*enerating a +ield ,rontier


&otal Jolume of (ulp logs K7m:

)ines 4oining e.treme points represent the +ield ,rontier


&otal Jolume 67m: of Sa logs

*enerating a +ield ,rontier


/ Using pulp e formulate the -ucking pro-lem D ith a single o-4ectiveE as a set packing pro-lem -y log section.

lp L )p(ro-lemD;Aucking Model;0 )pMa.imi#eE Mset up the logvolume varia-les logvolL)pJaria-le.dictsD;)ogJolumeDN;OsN;E;0logtypes07E Mo-4ective lpHLlpSumDPl.price Q logvolPlR for l in logtypesRE0 ;'evenueS Msetup the arc varia-les .L)pJaria-le.dictD;.DOsE;0fTlogs07050)pIntegerE Mset up a section set partitioning pro-lem count L 7 for s in stems1 slogs L fsTlogsPsR for i0sec in enumerateDs.sectionsE1 lp HLD lpSumDD.PlogR for log in slogs if log.startl UL sec.start if log.endl V sec.startEE UL 5 0 ;StemTSectionDN;OsN;0OiE; O DstrDsE0iEE count HL 5 Madd the constraints that link the log volumes for lt in logtypes1 lp HLD lpSumDDlog.volumeQ.PlogR for log in flTlogsPltREE = logvolPltR LL 7 0 ;)ogtypeTvolumeDN;OsN;E; O strDltEE

*enerating a +ield ,rontier Using (ulp


/ %e then iteratively solve the pro-lem to find all e.treme supported solutions on the +ield ,rontier / ECuivalent to pro4ecting the pro-lem into the log volume space / I added a module to (u)( that implements pro4ection using Iterative Wull Methods D)asse#0 )asse# 5GG6E
VVV ppro-0 ppoints L polytope.pro4ectDlp0 totalvarsE

,ind +ield ,rontier for the Dataset


D70 X>7E D5<X0 XKGE D6:>0 X55E

D<:<05K>E

D70 7E

D86:0 :>E D8:80 7E

,ind +ield ,rontier for a Single Stem


NQ &otal pro4ected QN Minimi#e OAI1 TTdummy Su-4ect &o T$51 DomSa H 5.555>K>G886X e. UL 6XXG.6<>G6G>> T$61 DomSa H 5.:KX>:KX>:K< e. UL :558.><K6><K: T$:1 5.778X:G:788X DomSa H e. UL 6>66.X7XG55K> Aounds TTdummy L 7 End

&ravelling tournament pro-lem ith (u)(


/ &his pro-lem models the allocation of teams to Wome and A ay games in a tournament / A full pro-lem description and datasets are found at Michael &rick9s page / http1??mat.tepper.cmu.edu?&OU'N?

&ravelling tournament pro-lem ith (u)(


/ At I,O'S 6778 M. &rick presented an approach to finding lo er -ounds to this pro-lem using com-inatorial -enders cuts / &hat evening I implemented his algorithm using (u)( / Along the ay I also added (o erset0 $om-ination and (ermutation operators to (u)(

lp L )p(ro-lemD;&ravelling tournement Master;0 )pMinimi#eE Mcreate varia-les triplist L P&ripDt50pE for t5 in teams for p in allpermutationsDPt for t in teams if t FLt5R 0kE if pP7R UL pP=5RR tripvars L )pJaria-le.dictD;mastervar ;0triplist07050)pIntegerE Mo-4ective lp HL lpSumDPt.costDEQtripvarsPtR for t in triplistRE Mconstruct constraints to ensure that all teams visit each other for t5 in teams1 for t6 in teams1 if t5 FL t61 lp HL lpSumDPtripvarsPtR for t in triplist if t.team LL t5 if t6 in a.a ayteamsRE LL 50 N ;&eamTOsTJisitsTOs;ODt50t6E

,urther e.amples
/ &he :G6 course has -een converted from AM() to (u)(
http1??5:7.65X.67G.6:<?engsci:G6?pulp?Optimisation%ith(u)(

/ &here you can see a num-er of different ays to construct pro-lems / Note that ne language features can -e added very easily only needing approval from the AD,)

You might also like