<?xml version="1.0"?>
<oembed><version>1.0</version><provider_name>SOUL OF MATHEMATICS</provider_name><provider_url>https://soulofmathematics.com</provider_url><author_name>Rajarshi Dey</author_name><author_url>https://soulofmathematics.com/index.php/author/rajarshidey1729gmail-com/</author_url><title>The Knight's Tour - SOUL OF MATHEMATICS</title><type>rich</type><width>600</width><height>338</height><html>&lt;blockquote class="wp-embedded-content" data-secret="QwVBFKVdYW"&gt;&lt;a href="https://soulofmathematics.com/index.php/the-knights-tour/"&gt;The Knight&#x2019;s Tour&lt;/a&gt;&lt;/blockquote&gt;&lt;iframe sandbox="allow-scripts" security="restricted" src="https://soulofmathematics.com/index.php/the-knights-tour/embed/#?secret=QwVBFKVdYW" width="600" height="338" title="&#x201C;The Knight&#x2019;s Tour&#x201D; &#x2014; SOUL OF MATHEMATICS" data-secret="QwVBFKVdYW" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"&gt;&lt;/iframe&gt;&lt;script type="text/javascript"&gt;
/* &lt;![CDATA[ */
/*! This file is auto-generated */
!function(d,l){"use strict";l.querySelector&amp;&amp;d.addEventListener&amp;&amp;"undefined"!=typeof URL&amp;&amp;(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&amp;&amp;!/[^a-zA-Z0-9]/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),o=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),c=new RegExp("^https?:$","i"),i=0;i&lt;o.length;i++)o[i].style.display="none";for(i=0;i&lt;a.length;i++)s=a[i],e.source===s.contentWindow&amp;&amp;(s.removeAttribute("style"),"height"===t.message?(1e3&lt;(r=parseInt(t.value,10))?r=1e3:~~r&lt;200&amp;&amp;(r=200),s.height=r):"link"===t.message&amp;&amp;(r=new URL(s.getAttribute("src")),n=new URL(t.value),c.test(n.protocol))&amp;&amp;n.host===r.host&amp;&amp;l.activeElement===s&amp;&amp;(d.top.location.href=t.value))}},d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",function(){for(var e,t,s=l.querySelectorAll("iframe.wp-embedded-content"),r=0;r&lt;s.length;r++)(t=(e=s[r]).getAttribute("data-secret"))||(t=Math.random().toString(36).substring(2,12),e.src+="#?secret="+t,e.setAttribute("data-secret",t)),e.contentWindow.postMessage({message:"ready",secret:t},"*")},!1)))}(window,document);
/* ]]&gt; */
&lt;/script&gt;
</html><thumbnail_url>https://i0.wp.com/soulofmathematics.com/wp-content/uploads/2020/09/ILAIsmB.gif?fit=335%2C334&amp;ssl=1</thumbnail_url><thumbnail_width>335</thumbnail_width><thumbnail_height>334</thumbnail_height><description>The&#xA0;knight&#x2019;s tour problem&#xA0;is the&#xA0;mathematical problem&#xA0;of finding a knight&#x2019;s tour, and probably making knight the most interesting piece on the chess board. The knight visits every square exactly once, if the knight ends on a square that is one knight&#x2019;s move from the beginning square (so that it could tour the board again immediately, following the same path), the tour is closed; otherwise, it is open. The knight&#x2019;s tour problem is an instance of the more general&#xA0;Hamiltonian path problem&#xA0;in&#xA0;graph theory. The problem of finding a closed knight&#x2019;s tour is similarly an instance of the&#xA0;Hamiltonian cycle problem. Unlike the general Hamiltonian path problem, the knight&#x2019;s tour problem can be solved in&#xA0;linear time. Hamiltonian Path Problem In Graph Theory, a graph is usually defined to be a collection of nodes or vertices and the set of edges which define which nodes are connected with each other. So we use a well known notation of representing a graph G = (V,E) where&#xA0;V = { v1, v2, v3, &#x2026; , vn }&#xA0;and E = {(i, j)|i &#x2208; V and j &#x2208; V and i and j is connected}. Hamiltonian Path is defined to be a single path that visits every node in the given graph, or a permutation of nodes in such a way that for every adjacent node in the permutation there is an edge defined in the graph. Notice that it does not make much sense in repeating the same paths. In order to avoid this repetition, we permute with |V|C2 combinations of starting and ending vertices. Simple way of solving the Hamiltonian Path problem would be to permutate all possible paths and see if edges exist on all the adjacent nodes in the permutation. If the graph is a complete graph, then naturally all generated permutations would quality as a Hamiltonian path. For example. let us find a Hamiltonian path in graph G = (V,E) where V = {1,2,3,4} and E = {(1,2),(2,3),(3,4)}. Just by inspection, we can easily see that the Hamiltonian path exists in permutation 1234. The given algorithm will first generate the following permutations based on the combinations:1342 1432 1243 1423 1234 1324 2143 2413 2134 2314 3124 3214 The number that has to be generated is (|V|C2 ) (|V| &#x2013; 2)! Existence Schwenk&#xA0;proved that for any&#xA0;m&#xA0;&#xD7;&#xA0;n&#xA0;board with&#xA0;m&#xA0;&#x2264;&#xA0;n, a closed knight&#x2019;s tour is always possible&#xA0;unless&#xA0;one or more of these three conditions are met: m&nbsp;and&nbsp;n&nbsp;are both odd m&nbsp;= 1, 2, or 4 m&nbsp;= 3 and&nbsp;n&nbsp;= 4, 6, or 8. Cull&#xA0;and Conrad&#xA0;proved that on any rectangular board whose smaller dimension is at least 5, there is a (possibly open) knight&#x2019;s tour. n Number of directed tours (open and closed)on an&nbsp;n&nbsp;&#xD7;&nbsp;n&nbsp;board(sequence&nbsp;A165134&nbsp;in the&nbsp;OEIS) 1 1 2 0 3 0 4 0 5 1,728 6 6,637,920 7 165,575,218,320 8 19,591,828,170,979,904 Neural network solutions The neural network is designed such that each legal knight&#x2019;s move on the chessboard is represented by a neuron. Therefore, the network basically takes the shape of the&nbsp;knight&#x2019;s graph&nbsp;over an&nbsp;n&#xD7;n&nbsp;chess board. (A knight&#x2019;s graph is simply the set of all knight moves on the board) Each neuron can be either &#x201C;active&#x201D; or &#x201C;inactive&#x201D; (output of 1 or 0). If a neuron is active, it is considered part of the solution to the knight&#x2019;s tour. Once the network is started, each active neuron is configured so that it reaches a &#x201C;stable&#x201D; state if and only if it has exactly two neighboring neurons that are also active (otherwise, the state of the neuron changes). When the entire network is stable, a solution is obtained. The complete transition rules are as follows: where&#xA0;t&#xA0;represents time (incrementing in discrete intervals),&#xA0;U(Ni,j)&#xA0;is the state of the neuron connecting square&#xA0;i&#xA0;to square&#xA0;j,&#xA0;V(Ni,j)&#xA0;is the output of the neuron from&#xA0;i&#xA0;to&#xA0;j, and&#xA0;G(Ni,j)&#xA0;is the set of &#x201C;neighbors&#x201D; of the neuron (all neurons that share a vertex with&#xA0;Ni,j). Code For Knight&#x2019;s Tour</description></oembed>
