C# 分支定界法 01背包问题

来源:百度知道 编辑:UC知道 时间:2024/05/25 01:09:55
用C#编程通过分支定界法解决背包问题。急急急。

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Test01Bag
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public class Product
{
#region 商品类
/// <summary>
/// 商品重量泛型List存储
/// </summary>
private List<int> weight = new List<int>();

public List<int> Weight
{
get{ return weight; }
set{ weight = value; }
}
private List<int> value = new List<int>();
/// <summary>
/// 商品价值泛型List存储