prims,dijkstras & knapsack problem