Skip to content

Add Partition Equal Subset and Decode Ways Algorithms - #14

Open
miryala10sathvika wants to merge 3 commits into
nitheesh-me:mainfrom
miryala10sathvika:main
Open

Add Partition Equal Subset and Decode Ways Algorithms#14
miryala10sathvika wants to merge 3 commits into
nitheesh-me:mainfrom
miryala10sathvika:main

Conversation

@miryala10sathvika

@miryala10sathvika miryala10sathvika commented Nov 16, 2025

Copy link
Copy Markdown

What's Included

1. New Algorithm Modules

algorithms/partition-equal-subset.typ

  • Formal DP recurrence definition.
  • Mapcode-style specification (rho, F, pi).
  • Concrete DP computation for sample instance [1, 5, 11, 5].
  • Full 2D DP-table visualization using the project's mapcode-viz framework.
  • Structured layout showing items vs. target sums with boolean (T/F/⊥) markers.

algorithms/decode-ways.typ

  • Formal DP recurrence definition.
  • Mapcode-style specification (rho, F, pi).
  • Concrete DP computation for sample instances ("12", "226", "11106", "1201234").
  • Full 1D DP-array visualization using the project's mapcode-viz framework.
  • Summary table comparing multiple test cases and stepwise evaluation.

2. Documentation Integration

Updated main.typ:

  • Added #include "algorithms/partition-equal-subset.typ" after the 0-1 Knapsack section.
  • Added #include "algorithms/decode-ways.typ" after the Partition Equal Subset section.
  • Ensures both chapters appear in output in correct sequence.

Why This Matters

  • Brings two more classical DP problems into the mapcode framework, expanding coverage and enabling comparisons across problem classes.
  • Demonstrates boolean DP (Partition) and counting DP (Decode Ways) patterns useful for understanding different DP variants.
  • Serves as templates for future DP problem additions.

Files Changed

  • algorithms/partition-equal-subset.typ — 150 lines added
  • algorithms/decode-ways.typ — 180 lines added
  • main.typ — 4 lines added

No existing code modified; additions are isolated and non-breaking.

Checklist

  • Builds successfully
  • Renders correctly in main.typ
  • Follows repository style and structure
  • No backward-incompatible changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant