第5章-回溯法PPT
第5章 回溯法;本章主要知识点;*;*;*;*;*;子集树(两类典型问题);当所给问题是确定n个元素满足某种性质的排列时,相应的解空间树称为排列树。排列树通常有(n-1)!个叶结点。因此遍历排列树需要Ω(n!)计算时间。如旅行售货员问题。;回溯法解题步骤;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;public class FlowShop
static int n, // 作业数
f1, // 机器1完成处理时间
f, // 完成时间和
bestf; // 当前最优值
static int [][] m; // 各作业所需的处理时间
static int [] x; // 当前作业调度
static int [] bestx; // 当前最优作业调度
static int [] f2; // 机器2完成处理时间;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*;*; public class Fac5_12{
public static void main(String args[])
{
原创力文档

文档评论(0)