<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Algorithms on unordered</title>
		<link>https://unorde.red/categories/algorithms/</link>
		<description>Recent content in Algorithms on unordered</description>
		<generator>Hugo</generator>
		<language>en-US</language>
		
		
		
		
			<lastBuildDate>Sat, 17 Aug 2019 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://unorde.red/categories/algorithms/feed.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>RedpwnCTF: mallcop</title>
				<link>https://unorde.red/redpwnctf-mallcop/</link>
				<pubDate>Sat, 17 Aug 2019 00:00:00 +0000</pubDate>
				<guid>https://unorde.red/redpwnctf-mallcop/</guid>
				<description>&lt;p&gt;Mallcop was the least-solved challenge in the Misc category. We were given a&#xA;zipped file of 20 problem instances. The server gives us the following problem&#xA;description:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-txt&#34; data-lang=&#34;txt&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Sick of Chick-fil-A, Daniel&amp;#39;s son deserts him to make a break for the parking&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;lot. (Un?)fortunately, Max the Mall Cop is here to help!  The n stores in the&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mall are connected by walkways such that none of them form a cycle; in other&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;words, there is exactly one path from one store to another. Daniel&amp;#39;s son was&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;last seen at store k.  Stores connected to only one store lead to a parking lot.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Max the Mall Cop decides to station his miniature clones at some of these&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;parking lot stores.  Every minute, Daniel&amp;#39;s son and the miniature Maxes can move&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;one meter towards an adjacent store or stay put. Daniel&amp;#39;s son is caught when he&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;coincides with a miniature Max at a store or a walkway.  What is the minimum&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;number of miniature Maxes that Max the Mall Cop should station to ensure that&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Daniel&amp;#39;s son cannot reach a parking lot?&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Input:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    First line: n, k&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    Next n-1 lines: a, b, x indicating a walkway between stores a and b with&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        length x meters&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Output:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    One line with the minimum miniature Maxes needed.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Download the testcases from in.zip and enter your output here.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The server has us give the answer to each of the 20 instances one at a time, and&#xA;then disconnects us without giving any information if we got it wrong.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Topological sorts</title>
				<link>https://unorde.red/topological-sorts/</link>
				<pubDate>Sun, 12 Mar 2017 00:00:00 +0000</pubDate>
				<guid>https://unorde.red/topological-sorts/</guid>
				<description>&lt;p&gt;Detecting and finding cycles in directed graphs are common problems in graph theory. A while back I was looking for an algorithm to detect whether a graph had a cycle or not, and it turns out there are a lot of different ways to approach this. Ultimately, the best method to use will probably depend on why you&amp;rsquo;re looking for cycles, and what you want to do with them (or their absence).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Particle swarm optimization</title>
				<link>https://unorde.red/particle-swarm-optimization/</link>
				<pubDate>Wed, 15 Jul 2015 00:00:00 +0000</pubDate>
				<guid>https://unorde.red/particle-swarm-optimization/</guid>
				<description>&lt;p&gt;Particle swarm optimization (PSO) is a local search metaheuristic. It was initially developed by Kennedy, Eberhart and Shi in the late 1990s, and was meant to simulate social behaviour such as birds flocking to a promising position in a multi-dimensional space. A simplified version of the algorithm was found to perform optimization, which led to its adoptation as a local search algorithm.&lt;/p&gt;&#xA;&lt;p&gt;The algorithm is easy to implement, and makes very few assumptions about the problem. PSO can be applied to a wide range of optimization problems, as it does not use the objective function&amp;rsquo;s gradient and therefore does not require the objective function to be differentiable.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
