Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrt committed Jul 18, 2024
1 parent 0ff7fb6 commit 500f202
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions cmd/gmailctl/cmd/diff_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
)

var (
diffFilename string
diffDebug bool
diffFilename string
diffDebug bool
)

// diffCmd represents the diff command
Expand Down
34 changes: 18 additions & 16 deletions internal/graph/munkres.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ const (
)

// Munkres (Hungarian algorithm) method to solve the assignment problem
// based on code by Bob Pilgrim from http://csclab.murraystate.edu/bob.pilgrim/445/munkres.html
// Note: this method runs in O(n³), in the worst case; therefore is not efficient for large matrix
// Example:
// $ | Clean Sweep Wash
// -------|--------------------
// Fry | [2] 3 3
// Leela | 3 [2] 3
// Bender | 3 3 [2]
// minimum cost = 6
//
// Note: cost will be minimised
// based on code by Bob Pilgrim from http://csclab.murraystate.edu/bob.pilgrim/445/munkres.html
// Note: this method runs in O(n³), in the worst case; therefore is not efficient for large matrix
// Example:
// $ | Clean Sweep Wash
// -------|--------------------
// Fry | [2] 3 3
// Leela | 3 [2] 3
// Bender | 3 3 [2]
// minimum cost = 6
//
// Note: cost will be minimised
type Munkres struct {

// main
Expand Down Expand Up @@ -80,7 +80,8 @@ func (o *Munkres) Init(nrow, ncol int) {
}

// SetCostMatrix sets cost matrix by copying from C to internal o.C
// Note: costs must be positive
//
// Note: costs must be positive
func (o *Munkres) SetCostMatrix(C [][]float64) {
o.Cori = C
for i := 0; i < o.nrowOri; i++ {
Expand All @@ -101,11 +102,12 @@ func (o *Munkres) SetCostMatrix(C [][]float64) {
}

// Run runs the iterative algorithm
// Output:
// o.Links -- will contain assignments, where len(assignments) == nrow and
// j := o.Links[i] means that i is assigned to j
// -1 means no assignment/link
// o.Cost -- will have the total cost by following links
//
// Output:
// o.Links -- will contain assignments, where len(assignments) == nrow and
// j := o.Links[i] means that i is assigned to j
// -1 means no assignment/link
// o.Cost -- will have the total cost by following links
func (o *Munkres) Run() {

// column matrix
Expand Down

0 comments on commit 500f202

Please sign in to comment.