From f7119b936aa46935816ea4583463982ecd5e43cb Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 18 May 2026 09:33:14 +1200 Subject: [PATCH 1/4] [docs] udpate sports scheduling tutorial with a few minor changes --- .../src/tutorials/linear/sports_scheduling.jl | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/docs/src/tutorials/linear/sports_scheduling.jl b/docs/src/tutorials/linear/sports_scheduling.jl index fa58b6611df..bcaf080661e 100644 --- a/docs/src/tutorials/linear/sports_scheduling.jl +++ b/docs/src/tutorials/linear/sports_scheduling.jl @@ -24,8 +24,9 @@ # in 2016 as part of an operations research course at the University of # Wisconsin-Madison.** -# The purpose of this tutorial is to demonstrate a simple model for scheduling -# round-robin tournaments. As teams, it uses the [Big 10](https://en.wikipedia.org/wiki/Big_Ten_Conference). +# The purpose of this tutorial is to demonstrate a simple mixed-integer linear +# program for scheduling round-robin tournaments. As teams, it uses University +# teams from the [Big Ten Conference](https://en.wikipedia.org/wiki/Big_Ten_Conference). # (You might notice that there are more than 10 teams. Our example was also # written before the expansion of the Conference in 2024.) @@ -41,10 +42,20 @@ import HiGHS # Here are the teams in our tournament: M = [ - #!format:off - "Ind", "UMD", "UMich", "MSU", "OSU", "Penn", "Rtgrs", "Ill", "Iowa", "UMN", - "UNL", "NU", "Purd", "UW", - #!format: on + "Ill", # U. Illinois Urbana-Champaign + "Ind", # Indiana University Bloomington + "Iowa", # University of Iowa + "MSU", # Michigan State University + "NU", # Northwestern University + "OSU", # The Ohio State Univesity + "Penn", # Pennsylvania State University + "Purd", # Purdue University + "Rtgrs", # Rutgers University + "UMD", # University of Maryland, College Park + "UMich", # University of Michigan + "UMN", # University of Minnesota Twin Cities + "UNL", # University of Nebraska-Lincoln + "UW", # University of Wisconsin-Madison ]; # For each team to play each other exactly once, we need the number of teams - 1 @@ -113,7 +124,8 @@ Y = round.(Bool, value.(x)) print_schedule(M, T, Y) # This schedule is okay, but it features a large number of back-to-back away -# games. Let's count them: +# games (in which a team plays away from home two weeks in a row). Let's count +# them: number_of_back_to_back_away_games = sum(round(Int, value(sum(x[:, m, (t-1):t]))) == 2 for m in M, t in 2:T) From 3bc1afdcc66ef60e1fef9b2765e82a6d3ec04af1 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 18 May 2026 14:52:37 +1200 Subject: [PATCH 2/4] Update --- .github/workflows/documentation.yml | 2 +- docs/make.jl | 6 +++--- docs/src/tutorials/linear/sports_scheduling.jl | 13 +++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index def9921d3b0..0b9d76abddb 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -37,7 +37,7 @@ jobs: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key DOCUMENTER_LATEX_DEBUG: ${{ github.workspace }}/latex-debug-logs JULIA_NUM_THREADS: 4 - run: julia --color=yes --project=docs -p 2 docs/make.jl + run: julia --color=yes --project=docs -p 1 docs/make.jl - uses: actions/upload-artifact@v7 if: ${{ always() }} with: diff --git a/docs/make.jl b/docs/make.jl index c213c1bb7c7..8f5303597ee 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -22,10 +22,10 @@ end @time if _PDF || _IS_GITHUB_ACTIONS # Copy the src into a new directory for the latex build cp(joinpath(@__DIR__, "src"), joinpath(@__DIR__, "latex_src"); force = true) - f_latex = Distributed.@spawnat :any make_latex() - f_html = Distributed.@spawnat :any make_html() + p = only(Distributed.workers()) + f_latex = Distributed.@spawnat p make_latex() + make_html() fetch(f_latex) - fetch(f_html) # Hack for deploying: copy the pdf (and only the PDF) into the HTML build # directory! We don't want to copy everything in `latex_build` because it # includes lots of extraneous LaTeX files. diff --git a/docs/src/tutorials/linear/sports_scheduling.jl b/docs/src/tutorials/linear/sports_scheduling.jl index bcaf080661e..1315bb8291e 100644 --- a/docs/src/tutorials/linear/sports_scheduling.jl +++ b/docs/src/tutorials/linear/sports_scheduling.jl @@ -96,6 +96,19 @@ model = Model(HiGHS.Optimizer); sum(x[m, n, :]) + sum(x[n, m, :]) == 1, ); +# One problem with out model is that there is a lot of symmetry. To make the +# problem easier to solve, we fix the schedule of a random team to play every +# team in order, alternating between home and away: + +m = rand(M) +for (t, n) in enumerate(filter(!=(m), M)) + if isodd(t) + fix(x[m, n, t], 1) + else + fix(x[n, m, t], 1) + end +end + # Now we can solve our model: set_silent(model) From ebe406b3ce900bb254b839d71367f2948a64aa83 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 18 May 2026 15:14:58 +1200 Subject: [PATCH 3/4] Update --- .github/workflows/documentation.yml | 2 +- docs/make.jl | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 0b9d76abddb..def9921d3b0 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -37,7 +37,7 @@ jobs: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key DOCUMENTER_LATEX_DEBUG: ${{ github.workspace }}/latex-debug-logs JULIA_NUM_THREADS: 4 - run: julia --color=yes --project=docs -p 1 docs/make.jl + run: julia --color=yes --project=docs -p 2 docs/make.jl - uses: actions/upload-artifact@v7 if: ${{ always() }} with: diff --git a/docs/make.jl b/docs/make.jl index 8f5303597ee..a8af2abe8c7 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -22,10 +22,11 @@ end @time if _PDF || _IS_GITHUB_ACTIONS # Copy the src into a new directory for the latex build cp(joinpath(@__DIR__, "src"), joinpath(@__DIR__, "latex_src"); force = true) - p = only(Distributed.workers()) - f_latex = Distributed.@spawnat p make_latex() - make_html() + w = Distributed.workers() + f_latex = Distributed.remotecall(make_latex, w[1]) + f_html = Distributed.remotecall(make_html, w[2]) fetch(f_latex) + fetch(f_html) # Hack for deploying: copy the pdf (and only the PDF) into the HTML build # directory! We don't want to copy everything in `latex_build` because it # includes lots of extraneous LaTeX files. From 5966ae84b737a014a90f529b1f2ed396f5d709db Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Mon, 18 May 2026 17:19:14 +1200 Subject: [PATCH 4/4] Update make.jl --- docs/make.jl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index a8af2abe8c7..0927056ec24 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -22,11 +22,13 @@ end @time if _PDF || _IS_GITHUB_ACTIONS # Copy the src into a new directory for the latex build cp(joinpath(@__DIR__, "src"), joinpath(@__DIR__, "latex_src"); force = true) - w = Distributed.workers() - f_latex = Distributed.remotecall(make_latex, w[1]) - f_html = Distributed.remotecall(make_html, w[2]) - fetch(f_latex) - fetch(f_html) + # w = Distributed.workers() + # f_latex = Distributed.remotecall(make_latex, w[1]) + # f_html = Distributed.remotecall(make_html, w[2]) + # fetch(f_latex) + # fetch(f_html) + make_html() + make_latex() # Hack for deploying: copy the pdf (and only the PDF) into the HTML build # directory! We don't want to copy everything in `latex_build` because it # includes lots of extraneous LaTeX files.