Skip to content

Commit 8c41215

Browse files
authored
Update README to make a few things clearer (#160)
1 parent fae9a7b commit 8c41215

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

README.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ set_attribute(model, MOA.Algorithm(), MOA.Dichotomy())
4040
set_attribute(model, MOA.SolutionLimit(), 4)
4141
```
4242

43-
For worked examples, see the [Simple multi-objective examples](https://jump.dev/JuMP.jl/stable/tutorials/linear/multi_objective_examples/)
44-
tutorial in the JuMP documentation.
45-
4643
Replace `HiGHS.Optimizer` with an optimizer capable of solving a
4744
single-objective instance of your optimization problem.
4845

4946
You may set additional optimizer attributes, the supported attributes depend on
5047
the choice of solution algorithm.
5148

49+
For worked examples, see the [Simple multi-objective examples](https://jump.dev/JuMP.jl/stable/tutorials/linear/multi_objective_examples/)
50+
tutorial in the JuMP documentation. A larger example is the
51+
[Multi-objective knapsack](https://jump.dev/JuMP.jl/stable/tutorials/linear/multi_objective_knapsack/)
52+
tutorial, which also includes code for plotting the solutions.
53+
5254
## Algorithm
5355

5456
Set the algorithm using the `MOA.Algorithm()` attribute.
@@ -89,6 +91,18 @@ Query the number of scalar subproblems that were solved using
8991

9092
* `MOA.SubproblemCount()`
9193

94+
For example:
95+
96+
```julia
97+
using JuMP
98+
import HiGHS
99+
import MultiObjectiveAlgorithms as MOA
100+
model = Model(() -> MOA.Optimizer(HiGHS.Optimizer))
101+
# build the model
102+
optimize!(model)
103+
get_attribute(model, MOA.SubproblemCount())
104+
```
105+
92106
## Solution ordering
93107

94108
Results are lexicographically ordered by their objective vectors. The order
@@ -97,12 +111,20 @@ depends on the objective sense. The first result is best.
97111
## Ideal point
98112

99113
By default, MOA will compute the ideal point, which can be queried using the
100-
`MOI.ObjectiveBound` attribute.
114+
`MOI.ObjectiveBound` attribute (or `JuMP.objective_bound`).
101115

102116
Computing the ideal point requires as many solves as the dimension of the
103117
objective function. Thus, if you do not need the ideal point information, you
104118
can improve the performance of MOA by setting the `MOA.ComputeIdealPoint()`
105-
attribute to `false`.
119+
attribute to `false`:
120+
121+
```julia
122+
using JuMP
123+
import HiGHS
124+
import MultiObjectiveAlgorithms as MOA
125+
model = Model(() -> MOA.Optimizer(HiGHS.Optimizer))
126+
set_attribute(model, MOA.ComputeIdealPoint(), false)
127+
```
106128

107129
## Citation
108130

0 commit comments

Comments
 (0)