Introduction - If you have any usage issues, please Google them yourself
floyd knapsack
Floyd-Warshall algorithm (Floyd-Warshall algorithm) is an algorithm to solve the shortest path between any two points can correctly handle have the shortest path to the map or negative weights, but also be used to calculate the transitive closure of a directed graph package. Floyd-Warshall time complexity of the algorithm is O (N3), space complexity is O (N2).
Knapsack problem (Knapsack problem) is NP-complete optimization of a composition. The problem can be described as follows: given a set of items, each item has its own weight and price, for a limited total weight, how we choose to make the total price of the most goods. The name comes the question of how to choose the most suitable place objects in a given backpack.