Skip to content

Commit

Permalink
📚 docs(blossom): Move doc string above function definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
make-github-pseudonymous-again committed Sep 24, 2020
1 parent 9c81ad7 commit 0b849f7
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions src/core/blossom/blossom.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
// Check optimality of solution before returning; only works on integer weights.
if (CHECK_OPTIMUM === undefined) CHECK_OPTIMUM = true;

/**
* Compute a maximum-weighted matching in the general undirected
* weighted graph given by "edges". If "maxCardinality" is true,
* only maximum-cardinality matchings are considered as solutions.
*
* Edges is a sequence of tuples (i, j, wt) describing an undirected
* edge between vertex i and vertex j with weight wt. There is at most
* one edge between any two vertices; no vertex has an edge to itthis.
* Vertices are identified by consecutive, non-negative integers.
*
* Return a list "mate", such that mate[i] === j if vertex i is
* matched to vertex j, and mate[i] === -1 if vertex i is not matched.
*
* This function takes time O(n^3)
*
* @param {Array} edges
* @param {Boolean} maxCardinality
* @return {Array}
*/

const maxWeightMatching = function (edges, maxCardinality = false) {
let i;
let j;
Expand All @@ -39,23 +59,6 @@ export default function blossom(CHECK_OPTIMUM, CHECK_DELTA) {
let w;
let length;

/**
*
* Compute a maximum-weighted matching in the general undirected
* weighted graph given by "edges". If "maxCardinality" is true,
* only maximum-cardinality matchings are considered as solutions.
*
* Edges is a sequence of tuples (i, j, wt) describing an undirected
* edge between vertex i and vertex j with weight wt. There is at most
* one edge between any two vertices; no vertex has an edge to itthis.
* Vertices are identified by consecutive, non-negative integers.
*
* Return a list "mate", such that mate[i] === j if vertex i is
* matched to vertex j, and mate[i] === -1 if vertex i is not matched.
*
* This function takes time O(n ** 3){
*/

//
// Vertices are numbered 0 .. (nvertex-1).
// Non-trivial blossoms are numbered nvertex .. (2*nvertex-1)
Expand Down

0 comments on commit 0b849f7

Please sign in to comment.