rewelo

Relative Weight Tool Calculations

This document outlines all calculations used in the Relative Weight Tool, including details about field names, operations, and sorting.

Base Fields

The tool stores four fundamental values in the database:

  1. Benefit (B): The value gained by implementing a story (relative weight in agile Fibonacci: 1, 2, 3, 5, 8, 13, 21)
  2. Penalty (P): The cost of not implementing a story (relative weight in agile Fibonacci: 1, 2, 3, 5, 8, 13, 21)
  3. Estimate (E): The resources required to implement a story (relative weight in agile Fibonacci: 1, 2, 3, 5, 8, 13, 21)
  4. Risk (R): The uncertainty or complexity in implementation (relative weight in agile Fibonacci: 1, 2, 3, 5, 8, 13, 21)

Calculated Fields

The following values are calculated at runtime and not stored in the database. All calculations can be performed for the entire dataset or filtered by feature to compute metrics for stories within a specific feature:

Basic Calculations

Value = Benefit + Penalty
Cost = Estimate + Risk
Priority = Value / Cost

Relative Weight Calculations

Relative weights normalize each story's values against the total sum of all stories:

Relative Benefit = Benefit / Sum of all Benefits
Relative Penalty = Penalty / Sum of all Penalties
Relative Estimate = Estimate / Sum of all Estimates
Relative Risk = Risk / Sum of all Risks

Relative weights are reported to four significant digits, so small shares in large backlogs don't round to 0. Tables show two decimals, and <0.01 for a share that is not zero but smaller than that.

Weighted Calculations

The tool also supports weighted calculations where each factor can be given different importance:

Weighted Priority = (w1*Benefit + w2*Penalty) / (w3*Estimate + w4*Risk)

Where:

Weights are set per project with rw config weights --set --w1 … --w4 … (MCP: weight_set), or given for a single run with --w1..--w4 on rw calc priority (MCP: calc_priority), to emphasise different factors according to business priorities.

Feature-Level Calculations

All of the above calculations can also be performed at the feature level:

Sorting

rw ticket list --sort <field> (MCP: ticket_list with sort) sorts tickets in descending order by any of these fields:

  1. Base Fields (benefit, penalty, estimate, risk):
    • Sorted directly by their numeric values
  2. value:
    • Calculated as Benefit + Penalty
    • Sorted by this calculated value
  3. cost:
    • Calculated as Estimate + Risk
    • Sorted by this calculated value
  4. priority:
    • Calculated as Value / Cost
    • Sorted by the exact ratio, not the rounded value shown

The database only stores the 4 base values (Benefit, Penalty, Estimate, Risk); the calculated fields are computed in memory after retrieving them. The dashboard (rw report dashboard) is a static page whose ticket table is sorted by priority.

Edit calculations.md on GitHub