Skip to content

Commit

Permalink
Update doc comment for branch and bound
Browse files Browse the repository at this point in the history
  • Loading branch information
yancyribbens committed Oct 17, 2024
1 parent af12a43 commit 60d6217
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/branch_and_bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,25 @@ use crate::WeightedUtxo;
/// None is returned. Also, if no match can be found, None is returned. The semantics may
/// change in the future to give more information about errors encountered.
///
/// # Returns
/// * `Some(Vec<WeightedUtxo>)` where `Vec<WeightedUtxo>` is not empty on match.
/// * `None` No match found or un-expected results.
/// # Parameters
///
/// # Arguments
/// * target: Target spend `Amount`
/// * cost_of_change: The `Amount` needed to produce a change output
/// * fee_rate: `FeeRate` used to calculate each effective_value output value
/// * weighted_utxos: The candidate Weighted UTXOs from which to choose a selection from
///
/// # Returns
///
/// * `Some(Vec<WeightedUtxo>)` where `Vec<WeightedUtxo>` is some (non-empty) vector.
/// The search result succedded and a match was found.
/// * `None` un-expected results OR no match found. A future implementation can add Error types
/// which will differentiate between an unexpected error and no match found. Currently, a None
/// type occurs when one or more of the following criteria are met:
/// - Iteration limit hit
/// - Overflow when summing the UTXO space
/// - Not enough potential amount to meet the target, etc
/// - Target Amount is zero (no match possible)
/// - UTXO space was searched succefully however no match was found

// This search explores a binary tree. The left branch of each node is the inclusion branch and
// the right branch is the exclusion branch.
Expand Down

0 comments on commit 60d6217

Please sign in to comment.