<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?action=history&amp;feed=atom&amp;title=Algorithms</id>
	<title>Algorithms - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?action=history&amp;feed=atom&amp;title=Algorithms"/>
	<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;action=history"/>
	<updated>2026-04-25T19:54:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;diff=101&amp;oldid=prev</id>
		<title>WikiSysop: /* Exercises */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;diff=101&amp;oldid=prev"/>
		<updated>2025-08-05T09:52:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exercises&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:52, 5 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The size of your knapsack is 342. You can start with selecting among the first 20 items on the list for testing. The problem grows exponentially larger with the number of items, so do be careful how many you select from.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The size of your knapsack is 342. You can start with selecting among the first 20 items on the list for testing. The problem grows exponentially larger with the number of items, so do be careful how many you select from.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The exercise can be done on your laptop. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Computerome &lt;/del&gt;is not needed, but can be used.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The exercise can be done on your laptop. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pupil1 &lt;/ins&gt;is not needed, but can be used.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Using the first 20 items on the list the result is&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Using the first 20 items on the list the result is&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Items: 13&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Items: 13&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;diff=49&amp;oldid=prev</id>
		<title>WikiSysop: /* Material for the lesson */</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;diff=49&amp;oldid=prev"/>
		<updated>2024-06-17T09:27:07Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Material for the lesson&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:27, 17 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=f0af095e-eb23-44b3-9221-af2701235802 Dr Jones on Branch &amp;amp; Bound]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=f0af095e-eb23-44b3-9221-af2701235802 Dr Jones on Branch &amp;amp; Bound]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=8ef014eb-aa14-45a1-8588-af2701232e21 MaxAlign example]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=8ef014eb-aa14-45a1-8588-af2701232e21 MaxAlign example]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;HPCLife05&lt;/del&gt;-Algorithms.ppt Algorithms]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22112_08&lt;/ins&gt;-Algorithms.ppt Algorithms]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Example: [https://teaching.healthtech.dtu.dk/material/22112/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;HPCLife05&lt;/del&gt;-MaxAlign.ppt MaxAlign]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Example: [https://teaching.healthtech.dtu.dk/material/22112/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22112_08&lt;/ins&gt;-MaxAlign.ppt MaxAlign]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Web service: [http://www.cbs.dtu.dk/services/MaxAlign MaxAlign web service]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Web service: [http://www.cbs.dtu.dk/services/MaxAlign MaxAlign web service]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;PDF:  [https://teaching.healthtech.dtu.dk/material/22112/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;HPCLife05&lt;/del&gt;-BranchBound.pdf Branch and Bound]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;PDF:  [https://teaching.healthtech.dtu.dk/material/22112/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;22112_08&lt;/ins&gt;-BranchBound.pdf Branch and Bound]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Example: [http://optlab-server.sce.carleton.ca/POAnimations2007/BranchAndBound.html B&amp;amp;B example]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Example: [http://optlab-server.sce.carleton.ca/POAnimations2007/BranchAndBound.html B&amp;amp;B example]&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=92087938-aa47-4dbf-8ee3-af2701231587 What is expected in exercises]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=92087938-aa47-4dbf-8ee3-af2701231587 What is expected in exercises]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
	<entry>
		<id>https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;diff=21&amp;oldid=prev</id>
		<title>WikiSysop: Created page with &quot;{| width=500  style=&quot;float:right; margin-left: 10px; margin-top: -56px;&quot; |Previous: What affects performance |Next: Parallel programming |} == Material for the lesson == Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a7649b3f-c5bd-4326-be50-af270123913f Algorithms are good]&lt;br&gt; Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=f0af095e-eb23-44b3-9221-af2701235802 Dr Jones on Branch &amp; Bound]&lt;br&gt; Video: [https://panopto.dtu.dk/Panopto/Pages/V...&quot;</title>
		<link rel="alternate" type="text/html" href="https://teaching.healthtech.dtu.dk:443/22112/index.php?title=Algorithms&amp;diff=21&amp;oldid=prev"/>
		<updated>2024-03-06T10:54:36Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| width=500  style=&amp;quot;float:right; margin-left: 10px; margin-top: -56px;&amp;quot; |Previous: &lt;a href=&quot;/22112/index.php/What_affects_performance&quot; title=&quot;What affects performance&quot;&gt;What affects performance&lt;/a&gt; |Next: &lt;a href=&quot;/22112/index.php/Parallel_programming&quot; title=&quot;Parallel programming&quot;&gt;Parallel programming&lt;/a&gt; |} == Material for the lesson == Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a7649b3f-c5bd-4326-be50-af270123913f Algorithms are good]&amp;lt;br&amp;gt; Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=f0af095e-eb23-44b3-9221-af2701235802 Dr Jones on Branch &amp;amp; Bound]&amp;lt;br&amp;gt; Video: [https://panopto.dtu.dk/Panopto/Pages/V...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| width=500  style=&amp;quot;float:right; margin-left: 10px; margin-top: -56px;&amp;quot;&lt;br /&gt;
|Previous: [[What affects performance]]&lt;br /&gt;
|Next: [[Parallel programming]]&lt;br /&gt;
|}&lt;br /&gt;
== Material for the lesson ==&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=a7649b3f-c5bd-4326-be50-af270123913f Algorithms are good]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=f0af095e-eb23-44b3-9221-af2701235802 Dr Jones on Branch &amp;amp; Bound]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=8ef014eb-aa14-45a1-8588-af2701232e21 MaxAlign example]&amp;lt;br&amp;gt;&lt;br /&gt;
Powerpoint: [https://teaching.healthtech.dtu.dk/material/22112/HPCLife05-Algorithms.ppt Algorithms]&amp;lt;br&amp;gt;&lt;br /&gt;
Example: [https://teaching.healthtech.dtu.dk/material/22112/HPCLife05-MaxAlign.ppt MaxAlign]&amp;lt;br&amp;gt;&lt;br /&gt;
Web service: [http://www.cbs.dtu.dk/services/MaxAlign MaxAlign web service]&amp;lt;br&amp;gt;&lt;br /&gt;
PDF:  [https://teaching.healthtech.dtu.dk/material/22112/HPCLife05-BranchBound.pdf Branch and Bound]&amp;lt;br&amp;gt;&lt;br /&gt;
Example: [http://optlab-server.sce.carleton.ca/POAnimations2007/BranchAndBound.html B&amp;amp;B example]&amp;lt;br&amp;gt;&lt;br /&gt;
Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=92087938-aa47-4dbf-8ee3-af2701231587 What is expected in exercises]&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
In the file &amp;#039;&amp;#039;&amp;#039;knapsack.lst&amp;#039;&amp;#039;&amp;#039; you find 100 different items with varying size and value.&amp;lt;br&amp;gt;&lt;br /&gt;
Make a program that selects the subset of items that can be in your knapsack and has the biggest value. This is a combinatorial maximization problem.&amp;lt;br&amp;gt;&lt;br /&gt;
The size of your knapsack is 342. You can start with selecting among the first 20 items on the list for testing. The problem grows exponentially larger with the number of items, so do be careful how many you select from.&lt;br /&gt;
&lt;br /&gt;
The exercise can be done on your laptop. Computerome is not needed, but can be used.&amp;lt;br&amp;gt;&lt;br /&gt;
Using the first 20 items on the list the result is&amp;lt;br&amp;gt;&lt;br /&gt;
Items: 13&amp;lt;br&amp;gt;&lt;br /&gt;
Combined size: 341.7&amp;lt;br&amp;gt;&lt;br /&gt;
Combined value: 1704.8&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is known as &amp;quot;The Knapsack Problem&amp;quot; and is typically solved using the Branch and Bound paradigm.&amp;lt;br&amp;gt;&lt;br /&gt;
https://en.wikipedia.org/wiki/Knapsack_problem&lt;br /&gt;
&lt;br /&gt;
Challenge: Done right, this can be solved for the entire list in less than 1/10 second, done wrong you can wait years for the program to finish.&lt;br /&gt;
&lt;br /&gt;
To help you understand the core of the &amp;quot;branch&amp;quot; part of the algorithm that goes through the search tree, run this python code.&lt;br /&gt;
It is here for your understanding, not for performance. Once you understand the principle, you can adapt the code to your problem.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
&lt;br /&gt;
maxsize = 100&lt;br /&gt;
problem = &amp;#039;XXXX&amp;#039;&lt;br /&gt;
bestproblem = &amp;#039;&amp;#039;&lt;br /&gt;
bestvalue = 0&lt;br /&gt;
stack = [problem]&lt;br /&gt;
&lt;br /&gt;
while len(stack) &amp;gt; 0:&lt;br /&gt;
    problem = stack.pop()&lt;br /&gt;
    # Calculate bound/estimate and constraint of choices&lt;br /&gt;
    # This is not done for you - calculate your own&lt;br /&gt;
    estimate = 0&lt;br /&gt;
    size = 45&lt;br /&gt;
    # if bound/estimate is worse than any previous found solution, discard&lt;br /&gt;
    if estimate &amp;lt; bestvalue:&lt;br /&gt;
        continue&lt;br /&gt;
    # Are constraints exceeded, discard&lt;br /&gt;
    if size &amp;gt; maxsize:&lt;br /&gt;
        continue&lt;br /&gt;
    # Still not solved, then split the problem&lt;br /&gt;
    if &amp;#039;X&amp;#039; in problem:&lt;br /&gt;
        nextx = problem.find(&amp;#039;X&amp;#039;)&lt;br /&gt;
        stack.append(problem[:nextx] + &amp;#039;1&amp;#039; + problem[nextx+1:])&lt;br /&gt;
        stack.append(problem[:nextx] + &amp;#039;0&amp;#039; + problem[nextx+1:])&lt;br /&gt;
    # Solved, is the better than any solution so far?&lt;br /&gt;
    elif estimate &amp;gt; bestvalue:&lt;br /&gt;
        bestvalue = estimate&lt;br /&gt;
        bestproblem = problem&lt;br /&gt;
    # What is going on with the stack???&lt;br /&gt;
    print(stack)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
	</entry>
</feed>