New answers tagged combinatorics
1
vote
Accepted
How to count the number of topological sorts in a directed acyclic graph with multiple roots
The problem is #P-complete (for example, see the last example in https://en.wikipedia.org/wiki/%E2%99%AFP-complete#Examples), so you should not expect any efficient algorithm that works on all ...
D.W.♦
- 166k
0
votes
Efficient Algorithm to Count Permutations of Boss Fights with Divisibility Constraints in an RPG Game
State Definition: Let $dp[i][s][k]$ be the number of ways to select elements from the first $i$ items such that:
The sum modulo 4 is $s$ (i.e., $s = (\sum_{j=1}^{i} a_j b_j) \mod 4$)
The number of ...
Top 50 recent answers are included
Related Tags
combinatorics × 771algorithms × 277
graphs × 139
optimization × 100
discrete-mathematics × 57
complexity-theory × 41
dynamic-programming × 41
permutations × 39
sets × 32
data-structures × 27
time-complexity × 26
trees × 26
probability-theory × 25
reference-request × 20
counting × 20
algorithm-analysis × 19
word-combinatorics × 18
np-complete × 17
np-hard × 16
binary-trees × 16
recursion × 14
matching × 14
matrices × 13
knapsack-problems × 13
set-cover × 13