Skip to content

Commit

Permalink
pump v0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jbytecode committed Mar 15, 2024
1 parent 1d22e08 commit 6ac59f9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
### 0.1.6 (Upcoming release)
### 0.1.7 (Upcoming release)

### 0.1.6

- Add Latex support for Transportation tables
- Pretty printing simplex iterations
- Automatic calculation of objective value by iterations and manual calculation code is removed

- Non-negativity conditions of models in the definition stage

### 0.1.5

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OperationsResearchModels"
uuid = "8042aa49-e599-49ec-a8f7-b5b80cc82a88"
authors = ["Mehmet Hakan Satman <mhsatman@gmail.com>"]
version = "0.1.5"
version = "0.1.6"

[deps]
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Expand Down
5 changes: 2 additions & 3 deletions src/maximumflow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function solve(cns::Array{Connection,1})
return :f
end
expr = @expression(model, 0)
for i = 1:length(lst)
for i = eachindex(lst)
expr += x[lst[i].from, lst[i].to]
end
return expr
Expand All @@ -58,7 +58,7 @@ function solve(cns::Array{Connection,1})

# Variables
@variable(model, f)
@variable(model, x[1:n, 1:n])
@variable(model, x[1:n, 1:n] .>= 0)

# Objective Function
@objective(model, Max, f)
Expand All @@ -78,7 +78,6 @@ function solve(cns::Array{Connection,1})

for nd in cns
@constraint(model, x[nd.from, nd.to] <= nd.value)
@constraint(model, x[nd.from, nd.to] >= 0)
end

@constraint(model, f >= 0)
Expand Down
2 changes: 1 addition & 1 deletion src/shortestpath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function solve(cns::Array{Connection,1})
return 0
end
expr = @expression(model, 0)
for i = 1:length(lst)
for i = eachindex(lst)
expr += x[lst[i].from, lst[i].to]
end
return expr
Expand Down
3 changes: 1 addition & 2 deletions src/transportation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ function solve(t::TransportationProblem)::TransportationResult

n, p = size(newt.costs)

@variable(model, x[1:n, 1:p])
@variable(model, x[1:n, 1:p] .>= 0)
@objective(model, Min, sum(newt.costs .* x))

@constraint(model, sum(x[1:n, j] for j = 1:p) .== newt.supply)
@constraint(model, sum(x[i, 1:p] for i = 1:n) .== newt.demand)
@constraint(model, x .>= 0)

optimize!(model)

Expand Down

2 comments on commit 6ac59f9

@jbytecode
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/102974

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.6 -m "<description of version>" 6ac59f9504cc3a97942a45095f42bdc183014ab2
git push origin v0.1.6

Please sign in to comment.