This is kind of part 15 of the series about: How to build a Constraint Programming solver? But it is also interesting for you if you don’t care about constraint programming.
You can learn how to use JuMP.jl as the modelling layer for your own solver.
Anyway these are the other posts so far in the ongoing series:
All of that can only happen because of the generous support of some people.
I’m very happy that I can cover my server expenses now because of my Patrons.
To keep this going please consider supporting this blog on Patreon. If you do I will create a better/faster blog experience and you will get posts like this earlier! Everything will be free forever but if you have some cash to spare -> This might be an option 😉
Special limited offer… I either just lost your attention or I have it now 😀
I decided to offer a 1:1 (binary) talk where you can ask me about my work and just chat with me if you’re willing to join the Patron 4$ club. 😉 This offer is until the 10th of February.
If you want to just keep reading -> Here you go 😉
Maybe I should have done that from the ground up but wasn’t sure how to and probably it was easier for the blog as well to start without a big code base. Therefore here it is now: Using JuMP.jl as the modelling layer for the constraint solver I’m creating for the past couple of months.
UserInterface change
Before I explain how it’s done I want to show how the user interface changes first:
How it was before
com = CS.init() # creating a constraint solver model
com_grid = Array{CS.Variable, 2}(undef, 9, 9)
for (ind,val) in enumerate(grid)
if val == 0
com_grid[ind] = add_var!(com, 1, 9)
else
com_grid[ind] = add_var!(com, 1, 9; fix=val)
end
end
for rc=1:9
#row
variables = com_grid[CartesianIndices((rc:rc,1:9))]
add_constraint!(com, CS.all_different([variables...]))
#col
variables = com_grid[CartesianIndices((1:9,rc:rc))]
add_constraint!(com, CS.all_different([variables...]))
end
which is a bit of the sudoku part. Now it looks like this:
m = Model(with_optimizer(CS.Optimizer))
@variable(m, 1 <= x[1:9,1:9] <= 9, Int)
# set variables
for r=1:9, c=1:9
if grid[r,c] != 0
@constraint(m, x[r,c] == grid[r,c])
end
end
for rc = 1:9
@constraint(m, x[rc,:] in CS.AllDifferentSet(9))
@constraint(m, x[:,rc] in CS.AllDifferentSet(9))
end
I think it looks a lot cleaner now but more importantly it is the standard interface for mathematical optimization solvers written in Julia.
This also means that if there will exist other constraint solvers in the future one can easily swap the…
As of Jan 1, 2020, Julia has been downloaded more than 12.95 million
times – an increase of 77% in just one year. Julia use and popularity
grew by double digits last year on every one of the 30+ metrics we
track, including those listed below.
Cumulative Julia Growth Statistics
Total as of Jan 1, 2019
Total as of Jan 1, 2020
Growth
Number of News Articles Mentioning Julia or Julia Computing
253
468
+85%
Discourse Views (Julia Forums)
12,656,734
22,920,570
+81%
Julia Downloads (JuliaLang.org + Docker Hub + JuliaPro)
7,305,737
12,950,630
+77%
Published Citations of Julia: A Fast Dynamic Language for Technical Computing (2012) + Julia: A Fresh Approach to Numerical Computing (2017)
1,048
1,680
+60%
YouTube Julia Language Channel Views
1,013,276
1,562,223
+54%
Julia Computing Pharmacometrics Webinar Featuring PumasAI and
Pumas.jl: Julia Computing is hosting a free one hour Webinar on Friday
Jan 24 from 12-1 pm EST (US) to discuss pharmacology modeling using Pumas.jl. The Webinar is led by Vijay Ivaturi,
Professor of Pharmacology at the University of Maryland School of
Pharmacy who initiated and leads the Pumas
project. Please click here
to register.
Alan Edelman’s Sidney Fernbach Award Presentation on the ‘Power of
Language’ Now Available on YouTube: Alan Edelman accepted the Sidney
Fernbach Award at SC19 with a presentation on the ‘Power of
Language’. This presentation is now available on
YouTube. Alan is
co-creator of Julia, co-founder and Chief Scientist at Julia Computing,
director of the Julia Lab at MIT and Professor of Applied Mathematics at
MIT. He was awarded the Sidney Fernbach Award for “outstanding
breakthroughs in high-performance computing, linear algebra, and
computational science and for contributions to the Julia programming
language.”
JuliaCon 2020 Deadlines:JuliaCon
2020 will take place July 27-31 at ISCTE –
Instituto Universitário de Lisboa (ISCTE-IUL) in Lisbon, Portugal.
JuliaCon 2020 Call for
Proposals: JuliaCon 2020
proposals are due March 7, 2020. Proposal types include talks,
lightning talks, minisymposia, workshops, posters and ‘Birds of a
Feather’ breakout sessions. Please review submission guidelines,
prepare and submit your
proposal no later than March
7, 2020. Mentorship is also available for new presenters.
Early Bird Ticket Discount:
Early Bird Tickets are available for purchase now through April
20, 2020. Please purchase
your tickets early to take advantage of discounted pricing.
JuliaCon 2020 Sponsors:
JuliaCon relies on the support of sponsors. Click here for more information
about becoming a JuliaCon sponsor.
Julia #1 Most Exciting New Language for Bioinformatics:
Bioinformatics scientist Albert Vilella conducted a survey
and identified Julia as the #1 most exciting new language for
bioinformatics.
Parallel Computing and Scientific Machine Learning: MIT instructor
Chris Rackauckas has published his lecture
notes on parallel computing and
scientific machine learning. Lectures include introductions to Julia,
scientific machine learning, code optimization, high performance
computing, parallelism, ordinary differential equations, automatic
differentiation, differentiable programming, GPU computing, neural
networks and more.
Julia for High Schoolers: Julia Computing co-founder and CTO (Tools)
Keno Fischer participated in a Skype a
Scientist session with students at
Athens High School in Athens, Alabama. Keno discussed programming
languages, supercomputers, and how to get started on programming as a
high school student.
Julia On the March: James Warner asks
“Is Julia Set to Take Over Python the Same Way Python Took Over Java?”
Click here
to read more.
Julia Computing Enterprise Solutions:Contact Julia
Computing for more information about
putting Julia to work for your organization, deploying Julia more
efficiently, effectively and at scale.
JuliaSure: JuliaSure
provides enterprise support and indemnity for organizations
using Julia.
JuliaTeam: JuliaTeam
provides enterprise governance including private and package
development, deployment, management, security, support
and indemnity.
JuliaRun: JuliaRun allows
you to scale Julia deployment from a single machine to dozens or
hundreds of nodes in a public or private cloud environment,
including AWS, Azure or Google Cloud.
JuliaBox 30 Day Free Trial:JuliaBox
is now available with a 30 day free trial. JuliaBox is the fastest and
easiest way to start using Julia right away with no download required. Register today to start your 30 day free
trial.
JuliaBox Academic Discount: Hundreds of students and faculty at
universities around the world use JuliaBox for classroom instruction and
learning. Use free and open source
materials to design your own course
using Julia. JuliaBox starts at just $7 per month including a 50%
academic discount. Sign up online or contact Julia Computing to take
advantage of the academic discount or for more information.
Do you work at or know of an organization looking to hire Julia
programmers as staff, research fellows or interns? Would your employer
be interested in hiring interns to work on open source packages that are
useful to their business? Help us connect members of our community to
great opportunities by sending us an email, and we’ll get the word out.
There are more than 300 Julia jobs currently listed on Indeed.com, including jobs at Accenture,
Airbus, Amazon, AstraZeneca, AT&T, Barnes & Noble, BlackRock, Capital
One, CBRE, Charles River Analytics, Citigroup, Comcast, Conde Nast,
Cooper Tire & Rubber, Disney, Dow Jones, Facebook, Gallup, Genentech,
General Electric, Google, Huawei, Ipsos, Johnson & Johnson, KPMG,
Lockheed Martin, Match, McKinsey, NBCUniversal, Netflix, Nielsen,
Novartis, OKCupid, Opendoor, Oracle, Pandora, Peapod, Pfizer, Raytheon,
Spectrum, Wells Fargo, Zillow, Brown, BYU, Caltech, Dartmouth, Emory,
Harvard, Johns Hopkins, Louisiana State University, Massachusetts
General Hospital, MIT, Penn State, Princeton, UC Davis, University of
Chicago, University of Delaware, University of Kentucky, UNC-Chapel
Hill, USC, University of Virginia, Argonne National Laboratory, Federal
Reserve Bank, Lawrence Berkeley National Laboratory, Los Alamos National
Laboratory, National Renewable Energy Laboratory, Oak Ridge National
Laboratory, Pacific Northwest National Laboratory, State of Wisconsin
and many more.
Purchase or obtain license information for Julia products such as
JuliaSure, JuliaTeam, or JuliaRun
Obtain pricing for Julia consulting projects for your organization
Schedule Julia training for your organization
Share information about exciting new Julia case studies or use cases
Spread the word about an upcoming conference, workshop, training,
hackathon, meetup, talk or presentation involving Julia
Partner with Julia Computing to organize a Julia meetup, conference,
workshop, training, hackathon, talk or presentation involving Julia
Submit a Julia internship, fellowship or job posting
About Julia and Julia Computing
Julia is the fastest high performance open
source computing language for data, analytics, algorithmic trading,
machine learning, artificial intelligence, and other scientific and
numeric computing applications. Julia solves the two language problem by
combining the ease of use of Python and R with the speed of C++. Julia
provides parallel computing capabilities out of the box and unlimited
scalability with minimal effort. Julia has been downloaded more than
12.95 million times and is used at more than 1,500 universities. Julia
co-creators are the winners of the 2019 James H. Wilkinson Prize for
Numerical Software and the 2019 Sidney Fernbach Award. Julia has run
at petascale on
650,000 cores with 1.3 million threads to analyze over 56 terabytes of
data using Cori, one of the ten largest and most powerful supercomputers
in the world.
Julia Computing was founded in 2015
by all the creators of Julia to develop products and provide
professional services to businesses and researchers using Julia.