<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Algorithms Q&amp;A - Recent questions and answers in CSP</title>
<link>https://notexponential.com/qa/artificial-intelligence/constraint-satisfaction-problems</link>
<description>Powered by Question2Answer</description>
<item>
<title>Answered: Comparison of Lottery Choices and MEU</title>
<link>https://notexponential.com/798/comparison-of-lottery-choices-and-meu?show=1022#a1022</link>
<description>&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;Expected utility setup: Instead of only expected value, we consider expected utility.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;u(3000),u(2000),u(0) - are the utilities.&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;Option A:&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;EU(A)=0.75u(3000)+0.25u(0)&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;Option B:&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;EU(B)=u(2000)&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;Option C&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;EU(C)=0.3u(3000)+0.7u(0)&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;Option D&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;EU(D)=0.4u(2000)+0.6u(0)&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;color:#000000&quot;&gt;Implications of the observation&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;From the observation, people prefer B over A. That means:&lt;/span&gt;&lt;/p&gt;&lt;p data-pm-slice=&quot;0 0 []&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;u(2000)&amp;gt;0.75u(3000)+0.25u(0)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;If we multiply both sides by 0.4 and then add 0.6u(0), we get:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;0.4u(2000)+0.6u(0)&amp;gt;0.3u(3000)+0.7u(0)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;This is exactly:&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;EU(D)&amp;gt;EU(C)&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;So, according to expected utility, if people prefer B over A, they should also prefer D over C.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;&lt;strong&gt;&lt;em&gt;Contradiction&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;However, the observation says people actually prefer C over D, which is the opposite result.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;So there is a contradiction.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:#000000&quot;&gt;This contradiction comes from violating the independence axiom of &lt;em&gt;expected utility theory&lt;/em&gt;. It basically&amp;nbsp;says that if one option is preferred over another, then mixing both with the same third outcome should not change the preference.&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;color:#000000&quot;&gt;Since the preference is reversed, it shows that people’s choices are not consistent with standard expected utility theory.&lt;/span&gt;&lt;/p&gt;&lt;p data-start=&quot;710&quot; data-end=&quot;815&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;/p&gt;&lt;p data-start=&quot;710&quot; data-end=&quot;815&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;/p&gt;&lt;p data-start=&quot;710&quot; data-end=&quot;815&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;/p&gt;&lt;p data-start=&quot;710&quot; data-end=&quot;815&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;display:none&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p data-start=&quot;710&quot; data-end=&quot;815&quot; style=&quot;caret-color: rgb(255, 255, 255); color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;display:none&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description>
<category>CSP</category>
<guid isPermaLink="true">https://notexponential.com/798/comparison-of-lottery-choices-and-meu?show=1022#a1022</guid>
<pubDate>Wed, 15 Apr 2026 10:13:13 +0000</pubDate>
</item>
<item>
<title>Answered: Snake - A through Y on a 5 x 5 grid</title>
<link>https://notexponential.com/797/snake-a-through-y-on-a-5-x-5-grid?show=965#a965</link>
<description>Let&amp;#039;s establish the important aspects for designing a solution to this constraint satisfaction problem (CSP):&lt;br /&gt;
&lt;br /&gt;
Variables: A variable is each cell in the 5x5 grid. There are a total of 25 cells.&lt;br /&gt;
Variable names can be written as (row, column), such as (1, 1) for the top-left cell.&lt;br /&gt;
&lt;br /&gt;
Domain: Each variable&amp;#039;s domain is the set of letters A through Y.&lt;br /&gt;
The filled cells already have fixed values and are removed from the domain of the variables that relate to them.&lt;br /&gt;
&lt;br /&gt;
Constraints: Adjacent cells must have letters that are either horizontally or vertically adjacent.&lt;br /&gt;
If two cells (i, j) and (k, l) are contiguous, the letters in those cells must also be adjacent in the English alphabet.&lt;br /&gt;
&lt;br /&gt;
Constraint Propagation:&lt;br /&gt;
&lt;br /&gt;
Constraint propagation entails iteratively lowering variable domains depending on constraints.&lt;br /&gt;
When a variable is assigned a value, the domains of its neighbors are modified in accordance with the adjacency requirement.&lt;br /&gt;
For example, if cell (1, 1) is allocated &amp;#039;R&amp;#039;, cells (1, 2) and (2, 1) must have domains confined to letters next to &amp;#039;R&amp;#039;.&lt;br /&gt;
The process is repeated until a solution is discovered or a variable has an empty domain, indicating an inconsistency.</description>
<category>CSP</category>
<guid isPermaLink="true">https://notexponential.com/797/snake-a-through-y-on-a-5-x-5-grid?show=965#a965</guid>
<pubDate>Fri, 22 Dec 2023 18:16:42 +0000</pubDate>
</item>
<item>
<title>Answered: Algorithm for Power Plant CSP</title>
<link>https://notexponential.com/757/algorithm-for-power-plant-csp?show=759#a759</link>
<description>As indicated in the problem, we have 3 main notions to consider, power plants, produced energy, and relevant cities. Power plants can simply be accepted as variables in CSP where relevant cities become available domains for each variable. Produced energy becomes related to the lower bound and upper bound limits(1000 and 1500 respectively). It is also said that each city must have at least 1 power plant around, so this is another constraint to be considered.&lt;br /&gt;
&lt;br /&gt;
While reading the domains, we should count how many times a city appears in the domains. If a city appears only in a single domain, a related power plant station is a necessary one. Therefore, the power plants can be separated into necessary and optional ones. This notion will be very handy for further propagation.&lt;br /&gt;
&lt;br /&gt;
First, node consistency can be used, eliminate those variables, which have produced energy over 1500. So, basically, they fail the unary constraint and if there is a city that only related to that power plant, that means there is no solution to the problem because it fails the constraint that each city must have at least 1 power station.&lt;br /&gt;
&lt;br /&gt;
Secondly, we can have path consistency applied to check whether, really, there is a path that can take us to the solution. It should be checked that the produced power summation of all power plant stations is not less than 1000 and the produced power summation of necessary plant stations where a unique city-related(this city only appears on this domain) is not over 1500. If these ones fail that means there is no solution to the problem.&lt;br /&gt;
&lt;br /&gt;
After the consistency check, the backtracking search can start. We can use a heuristic to weigh the necessity of the power plant station. The weight of the variable is dependent on the number of the unique cities it has in the domain, for example, let&amp;#039;s say we have 2 power stations 1 and 2 unique cities in the domain respectively. The first one will have 10**1 + # of remaining domain size(domain size - 1) and the second one will have 10**2 + # of remaining domain size(domain size - 2). Once we choose the variable, the domain values will be eliminated from the remaining variables&amp;#039; domains. If any variable remains with 0 domain, we store them in a list called optionals. They might be required if the power produced was not enough with the necessary ones.</description>
<category>CSP</category>
<guid isPermaLink="true">https://notexponential.com/757/algorithm-for-power-plant-csp?show=759#a759</guid>
<pubDate>Wed, 07 Apr 2021 09:05:16 +0000</pubDate>
</item>
</channel>
</rss>