Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
michel2323 committed Feb 17, 2022
1 parent 7ceb01b commit a27fcca
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@
This is the Julia interface to [ColPack](https://github.com/CSCsw/ColPack).

## Usage
```julia
verbose = 1
coloring = ColPackColoring("M.mtx", ColPack.d1, "RANDOM", 1)

### Read matrix market file
```julia
using ColPack
using MatrixMarket
coloring = ColPackColoring("m.mtx", ColPack.d1, "RANDOM")
println("Number of colors: ", length(unique(get_colors(coloring))))
println("Vector of vertex colors: ", get_colors(coloring))
```
### Pass the adjacency graph as a symmetric matrix of type `SparseMatrixCSC`
```julia
using ColPack
using LinearAlgebra
using SparseArrays
A = convert(SparseMatrixCSC, Symmetric(sprand(100,100,0.1)))
coloring = ColPackColoring(A, ColPack.d1, "RANDOM")
println("Number of colors: ", length(unique(get_colors(coloring))))
println("Vector of vertex colors: ", get_colors(coloring))
```
[build-url]: https://github.com/michel2323/ColPack.jl/actions?query=workflow

[build-stable-img]: https://github.com/michel2323/ColPack.jl/workflows/Run%20tests/badge.svg?branch=master

[build-url]: https://github.com/michel2323/ColPack.jl/actions?query=workflow
[build-stable-img]: https://github.com/michel2323/ColPack.jl/workflows/Run%20tests/badge.svg?branch=master

0 comments on commit a27fcca

Please sign in to comment.