This is the Solution for challenge of Summer of Bitcoin in Rust.
Maximize the Fee while minimizing the weight (≤ 4000000)
The problem is very similar to 0-1 Knapsack in a way. We need to maximize the fee while constraining the weight to HIGHEST_WT i.e. minimizing the weight. So to order the records we can sort it according to the ratio of fee/wt. Also if there is an unknown parent transaction we simply reject it.