Abstract:The product cost is of vital importance in the product market. It exerts a direct influence on the economic profits of the enterprise. So,how to calculate the product cost correctly is very important for an enterprise which participates in the social production. Using the concept of shadow price, this paper presents an efficient algorithm, to calculate the opportunity cost of product. The paper only deals with the most simple situation 1o promote the researches on more complicated problem.