Convex hull: present primal and dual formulations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Documentation
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- cpp
- Domain
- data, documentation
Research direction
Read the convex hull article and compare its dual formulation with the primal point based formulation described in the issue, using Project Euler 917 as the example mentioned. Work out how to explain the relationship between the two formulations and why interior points can be ignored; done means the article presents both formulations clearly. The issue does not name a file or test, so first locate the convex hull article in the repository.
Written by the indexing model from the issue text.
Description
The article introduces the dual formulation first, such as having a DP like
$$dp[i] = \min_{j < i} (dp[j] + m_j \cdot x_i) + C_i$$
The basic queries are for lines $y = m_j \cdot x + c_j$: evaluate lines at $x = d_i$ to find the lower envelope $\min_j (m_j \cdot d_i + c_j)$
However for problems like Project Euler 917, the primal formulation is with a linear cost like cost(x,y) = m * x + y querying directly on the points (x, y). Instead of maintaining a set of lines and computing where it crosses the hull, you just consider convex hull points directly, and you can reason to ignore interior points because they lie above the segments along the convex hull.
Idk if that makes sense. Basically mine is presented as if you already have the convex hull constructed, you can work directly with points. The math ends up the same but I think they are operating in some kind of point-line duality
- Dominant language
- C++
- Stars
- 11.2k
- Forks
- 2.2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cp-algorithms/cp-algorithms
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cp-algorithms/cp-algorithms#1774 ·
Maintainers usually reply within 1 day
-
Josephus article: the bulk-elimination equality uses the wrong modulusPossibly taken @Goldloli claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
cp-algorithms/cp-algorithms#1757 ·
Maintainers usually reply within 1 day
-
Centroid decomposition: clarify the proof that two centroids are adjacentPossibly taken @ntanthedev claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cp-algorithms/cp-algorithms#1756 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
cp-algorithms/cp-algorithms#1755 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
cp-algorithms/cp-algorithms#1754 ·
Maintainers usually reply within 1 day
All issues in cp-algorithms/cp-algorithms
Similar issues
-
Build fails on macOS 27: dyld refuses stripped Rust proc-macros (mis-aligned LINKEDIT string pool)Open
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
cloudflare/workerd#8963 ·
Maintainers usually reply within 1 day
-
Android Bug Core Drape
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
organicmaps/organicmaps#14449 ·
Maintainers usually reply within 1 day
-
comp-codecs
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ClickHouse/ClickHouse#135159 ·
Maintainers usually reply within 1 day
-
difficulty:easy func:python os:windows prio:high type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NatronGitHub/Natron#2029 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
ardazishvili/Sota#114 ·
Maintainers usually reply within 1 day