Enterprise competitiveness is based on resource optimization, which can be considered a knapsack problem with resource constraints at both an enterprise level and some specific-resource level. Modeling an enterprise from a resource-based perspective, in this article, a Mathematical Modeling based on a knapsack problem is built to analyze the optimization of enterprise resources that are inside and outside of the enterprise, and the basic genetic algorithm is applied to solve the optimization in the knapsack problem of enterprise resource optimization. Enterprise resource optimization schemes from the perspective of knapsack problems, help allocate and make full use of resources and form different capabilities, to realize the corporate strategy.