jenkinsci / jenkinsci/matrix-project-plugin

[JENKINS-1712] Try to make the matrix rectangular

Open
#331 0 comments 0 reactions 0 assignees View on GitHub
component:matrix-project-plugin enhancement imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
17
Forks
85
Avg merge
4h 27m
Merged PRs (30d)
5

Description

Try to classify axes into X and Y in a nice way so that the resulting table

would look rectangular.

This is essentially a knapsack problem and can be solved recursively with

memoization via dynamic programming:

http://en.wikipedia.org/wiki/Knapsack_problem#Dynamic_programming_solution

===============

Define a recursive function, A(i,j) to be the maximum value that can be attained

with cost less than or equal to j using items up to i.

We can define A(i,j) recursively as follows:


  • A(0,j) = 0

  • A(i,0) = 0

  • A(i,j) = A(i-1,j) if c_i > j

  • A(i,j) = max(A(i-1,j), v_i + A(i-1, j-c_i)) if c_i <= j.

    ===============

---
Originally reported by kohsuke, imported from: Try to make the matrix rectangular


  • status: Open
  • priority: Major
  • component(s): matrix-project-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 0
  • imported: 2025-12-06

Raw content of original issue

Try to classify axes into X and Y in a nice way so that the resulting table
would look rectangular.

This is essentially a knapsack problem and can be solved recursively with
memoization via dynamic programming:

http://en.wikipedia.org/wiki/Knapsack_problem#Dynamic_programming_solution
===============
Define a recursive function, A(i,j) to be the maximum value that can be attained
with cost less than or equal to j using items up to i.

We can define A(i,j) recursively as follows:


  • A(0,j) = 0

  • A(i,0) = 0

  • A(i,j) = A(i-1,j) if c_i > j

  • A(i,j) = max(A(i-1,j), v_i + A(i-1, j-c_i)) if c_i <= j.
    ===============


  • environment: Platform: All, OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.