Backtracking Algorithms Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report Learn Data Structures and Algorithms | DSA TutorialLearn more about Backtracking Algorithms in DSA Self Paced CoursePractice Problems on Backtracking AlgorithmsTop Quizzes on Backtracking Algorithms What is Backtracking? Backtracking can be defined as a general algorithmic technique that considers searching every possible combination in order to solve a computational problem. Backtracking Table of Content What is Backtracking? What is Backtracking Algorithm? Types of Backtracking Algorithm When can be Backtracking Algorithm used? Introduction of Backtracking Algorithm Standard Problems on Backtracking Easy problems on Backtracking Medium problems on Backtracking Hard problems on Backtracking What is Backtracking Algorithm? Backtracking is an algorithmic technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point of time (by time, here, is referred to the time elapsed till reaching any level of the search tree). Types of Backtracking Algorithm There are three types of problems in backtracking Decision Problem: In this, we search for a feasible solution. Optimization Problem: In this, we search for the best solution. Enumeration Problem: In this, we find all feasible solutions. When can be Backtracking Algorithm used? For example, consider the SudoKo solving Problem, we try filling digits one by one. Whenever we find that current digit cannot lead to a solution, we remove it (backtrack) and try next digit. This is better than naive approach (generating all possible combinations of digits and then trying every combination one by one) as it drops a set of permutations whenever it backtracks. Introduction of Backtracking: Introduction to Backtracking â Data Structure and Algorithm Tutorials Difference between Backtracking and Branch-N-Bound technique What is the difference between Backtracking and Recursion? Standard Problems on Backtracking: The Knightâs tour problem Rat in a Maze N Queen Problem | Backtracking-3 Subset Sum problem m Coloring Problem Hamiltonian Cycle Sudoku | Backtracking-7 Magnet Puzzle Remove Invalid Parentheses A backtracking approach to generate n bit Gray Codes Write a program to print all permutations of a given string Easy problems on Backtracking: Backtracking to find all subsets Check if a given string is sum-string Count all possible paths between two vertices Find all distinct subsets of a given set Find if there is a path of more than k length from a source Print all paths from a given source to a destination Print all possible strings that can be made by placing spaces Medium problems on Backtracking: Tug of War 8 queen problem Combinational Sum Warnsdorffâs algorithm for Knightâs tour problem Find paths from corner cell to middle cell in maze Find Maximum number possible by doing at-most K swaps Rat in a Maze with multiple steps or jump allowed N Queen in O(n) space Hard problems on Backtracking: Power Set in Lexicographic order Word Break Problem using Backtracking Partition of a set into K subsets with equal sum Longest Possible Route in a Matrix with Hurdles Find shortest safe route in a path with landmines Print all palindromic partitions of a string Printing all solutions in N-Queen Problem Print all longest common sub-sequences in lexicographical order Quick Links : Learn Data Structure and Algorithms | DSA Tutorial Top 20 Backtracking Algorithm Interview Questions âPractice Problemsâ on Backtracking âQuizâ on Backtracking âVideosâ on Backtracking Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule. Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks! DSA in C++ DSA in Java DSA in Python DSA in JavaScript Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore. Last Updated : 15 Jan, 2024 Like Article Save Article Next Introduction to Backtracking - Data Structure and Algorithm Tutorials Share your thoughts in the comments Add Your Comment Please Login to comment...