Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromxavier committed Jan 7, 2023
1 parent 4df8299 commit a109452
Showing 1 changed file with 31 additions and 11 deletions.
42 changes: 31 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,41 @@ julia> import Pkg
julia> Pkg.add("MQLib")
```

# Basic Usage
## Basic Usage
```julia
julia> using JuMP, MQLib
using JuMP, MQLib

julia> Q = [
-1 2 2
2 -1 2
2 2 -1
]
Q = [
-1 2 2
2 -1 2
2 2 -1
]

julia> model = Model(MQLib.Optimizer)
model = Model(MQLib.Optimizer)

julia> @variable(model, x[1:3], Bin)
@variable(model, x[1:3], Bin)
@objective(model, Max, x' * Q * x)

julia> @objective(model, Max, x' * Q * x)
optimize!(model)
```

## Selecting Heuristics

This wrapper allows one to access all 39 QUBO and Max-Cut Heuristics provided by [MQLib](https://github.com/MQLib/MQLib).
Selecting the method to be used can be achieved via JuMP's attribute interface:

julia> optimize!(model)
```julia
JuMP.set_optimizer_attribute(model, "heuristic", "ALKHAMIS1998")
```

or by calling MQLib helper functions:

```julia
MQLib.set_heuristic(model, "ALKHAMIS1998")
```

To list available heuristics and their descriptions, run:

```julia
MQLib.show_heuristics()
```

2 comments on commit a109452

@pedromxavier
Copy link
Member 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/75276

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.2 -m "<description of version>" a1094527abc35d10a863498786dbc2e8d0f05844
git push origin v0.1.2

Please sign in to comment.