大理大学学报 ›› 2023, Vol. 8 ›› Issue (6): 33-37.

• 数学与计算机科学 • 上一篇    下一篇

基于二叉树及不定长子树的集合子集求解回溯算法

赵秦怡,赵榆琴   

  1. 大理大学数学与计算机学院,云南大理 671003
  • 收稿日期:2022-08-02 修回日期:2022-09-09 出版日期:2023-06-15 发布日期:2023-06-26
  • 作者简介:赵秦怡,副教授,主要从事数据挖掘研究。

Backtracking Algorithms for Solving Set Subsets Based on Binary Tree and Variable Length Sub-ree

Zhao QinyiZhao Yuqin   

  1. College of Mathematics and Computer Dali University DaliYunnan 671003China
  • Received:2022-08-02 Revised:2022-09-09 Online:2023-06-15 Published:2023-06-26

摘要:

 回溯算法按深度优先在搜索树中进行搜索,搜索过程中不满足问题的约束条件则进行剪枝,适用于求解组合数较大的问题。提出基于二叉树及不定长子树的集合子集求解回溯算法,算法设计采用相容性技术,在搜索过程中不需要剪枝,可求解出所有的集合子集,算法时间复杂度较理想,算法运行效率高。基于不定长子树的集合子集求解回溯算法复杂度为O2n),问题求解规模增大时,算法效率更高。

关键词: font-family:宋体, ">回溯算法, 二叉树, 不定长子树

Abstract:

The backtracking algorithm adopts the depth-first search strategy and prunes when constraint condition dissatisfied which is suitable for solving problems with large combinations. Two backtracking algorithms based on binary tree and variable length sub-tree are proposed to solve the set subsets and the design of two algorithms uses compatibility technology and pruning is not required in the search process. All set subsets can be solved. The time complexity of the two algorithms is ideal and the operation efficiency of the algorithms is high. The complexity of the backtracking algorithm for solving set subsets based on variable length sub-tree is O 2n and the algorithm efficiency is higher when the scale of problem solving increases.

Key words: font-family:", ">backtracking algorithmfont-family:宋体, ">, font-family:", "> binary treefont-family:宋体, ">, font-family:", "> variable length sub-tree

中图分类号: