Answers.Body: <p><a href="https://en.wikipedia.org/wiki/Sequential_algorithm" rel="nofollow noreferrer">Sequential programming</a> would not be suitable for this kind of problem, but an algorithm could be implemented in a <a href="https://en.wikipedia.org/wiki/Declarative_programming" rel="nofollow noreferrer">declarative programming language</a>. I would suggest using <a href="https://en.wikipedia.org/wiki/Answer_set_programming" rel="nofollow noreferrer">Answer Set Programming</a>, a language that is designed for <a href="https://en.wikipedia.org/wiki/Logic_programming" rel="nofollow noreferrer">logic axioms</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-18T17:09:59.343Z
Answers.Text: I took the liberty of adding links.  Please don't hesitate to correct if I've gotten anything wrong.  (Thanks for this answer--"short and sweet" but but useful!)
Answers.UserDisplayName: DukeZhou
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-18T03:57:56.320Z
Answers.LastActivityDate: 2018-05-18T17:08:38.880Z
Answers.LastEditDate: 2018-05-18T17:08:38.880Z
Answers.UserDisplayName: The Impossible Squish
Answers.Body: <p>I sounds to me like something that could be expressed as a planning problem. You have a start state, end end state, and a set of actions. You need to find the correct actiona sequence to get from the start to the goal.</p>
  <p>You could probably express this in <a href="https://en.wikipedia.org/wiki/Planning_Domain_Definition_Language" rel="nofollow noreferrer">PDDL</a> and use a planner to find the right steps.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-21T08:14:57.643Z
Answers.LastActivityDate: 2021-05-21T08:14:57.643Z
Answers.UserDisplayName: Oliver Mason
Body: <p>Let say that we have four straight string with colors RED, GREEN, BLUE and YELLOW. These strings are tied up randomly. We know the current state of string (like starting point, where we should we start untying from) and the final state (where current string must look like after untying them).</p>
  
  <p>Here is a very simple example of the problem:</p>
  
  <p><a href="https://i.sstatic.net/tI6ah.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tI6ah.png" alt="a sample of the puzzle"></a></p>
  
  <p>At every move, we are allowed to replace only two nearby strings. For example, to solve the shown problem, we should do the following replacements:</p>
  
  <p>1) Replace GREEN and YELLOW</p>
  
  <p>2) Replace BLUE and GREEN</p>
  
  <p>But in a programming environment, how can I calculate the movements to untie the strings? What will be the algorithm specifically to solve such type of problems? Here is another <a href="https://math.stackexchange.com/questions/2581164/string-knots-unlocking-algorithm">variation</a> of the question. Its not possible to solve this problem according to the answer.</p>
  
Tags: <algorithm><logic>
Title: String node untying algorithm
UserDisplayName: TheSlv
ThreadText: # String node untying algorithm
  
  (Asked by: username_0 on 2017-12-23)
  
  Let say that we have four straight string with colors RED, GREEN, BLUE and YELLOW. These strings are tied up randomly. We know the current state of string (like starting point, where we should we start untying from) and the final state (where current string must look like after untying them).
  
  Here is a very simple example of the problem:
  
  [![a sample of the puzzle](https://i.sstatic.net/tI6ah.png)](https://i.sstatic.net/tI6ah.png)
  
  At every move, we are allowed to replace only two nearby strings. For example, to solve the shown problem, we should do the following replacements:
  
  1) Replace GREEN and YELLOW
  
  2) Replace BLUE and GREEN
  
  But in a programming environment, how can I calculate the movements to untie the strings? What will be the algorithm specifically to solve such type of problems? Here is another [variation](https://math.stackexchange.com/questions/2581164/string-knots-unlocking-algorithm) of the question. Its not possible to solve this problem according to the answer.
  
  **Tags:** algorithm, logic
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-05-18. Score: 1
  
  [Sequential programming](https://en.wikipedia.org/wiki/Sequential_algorithm) would not be suitable for this kind of problem, but an algorithm could be implemented in a [declarative programming language](https://en.wikipedia.org/wiki/Declarative_programming). I would suggest using [Answer Set Programming](https://en.wikipedia.org/wiki/Answer_set_programming), a language that is designed for [logic axioms](https://en.wikipedia.org/wiki/Logic_programming).
  
  > **Comments:**
  > **username_2**: I took the liberty of adding links.  Please don't hesitate to correct if I've gotten anything wrong.  (Thanks for this answer--"short and sweet" but but useful!)  
  
  ---
  
  ### Answer by username_3 on 2021-05-21. Score: 0
  
  I sounds to me like something that could be expressed as a planning problem. You have a start state, end end state, and a set of actions. You need to find the correct actiona sequence to get from the start to the goal.
  
  You could probably express this in [PDDL](https://en.wikipedia.org/wiki/Planning_Domain_Definition_Language) and use a planner to find the right steps.
  
  
  ---
  
  