from heapq import *
from random import randint
n1 = [4,5,6]
n2 = [2,3]
n3 = [1,3]
n4 = [3,6]
n5 = [7,8]
total = []
bestd = 0
bestx = []
b = []
hlist = []
from heapq import *
from random import randint
class boardnode(object):
def __init__(self,n,m):
self.now = [0 for i in range(m+1)]
self.s = 0
self.cd = 0
self.x = []
def __cmp__(self, other):
return cmp(self.cd, other.cd)
def __str__(self):
print 'self.cd = %d' % self.cd
print 'self.x = ', self.x
return ''
def __repr__(self):
return str(self.cd)
def init_data(n,m):
global n1,n2,n3,n4,n5,total,bestd,bestx,curd,curx,now,b,hplist
b = [[0 for i in range(m+1)] for i in range(n+1)]
for i in n1:
b[i][1] = 1
for i in n2:
b[i][2] = 1
for i in n3:
b[i][3] = 1
电路板排列问题分支限界解法(python)
最新推荐文章于 2024-06-19 16:42:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)