<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tessellations of Technology</title>
	<atom:link href="http://tessellationsoftechnology.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tessellationsoftechnology.wordpress.com</link>
	<description>A Blog about Science,Computing and related Technologies</description>
	<lastBuildDate>Tue, 10 Jan 2012 18:26:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tessellationsoftechnology.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tessellations of Technology</title>
		<link>http://tessellationsoftechnology.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tessellationsoftechnology.wordpress.com/osd.xml" title="Tessellations of Technology" />
	<atom:link rel='hub' href='http://tessellationsoftechnology.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Invention is so easy.Isn&#8217;t it?</title>
		<link>http://tessellationsoftechnology.wordpress.com/2010/11/26/invention-is-so-easy-isnt-it/</link>
		<comments>http://tessellationsoftechnology.wordpress.com/2010/11/26/invention-is-so-easy-isnt-it/#comments</comments>
		<pubDate>Fri, 26 Nov 2010 00:02:48 +0000</pubDate>
		<dc:creator>ishandutta2007</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tessellationsoftechnology.wordpress.com/?p=163</guid>
		<description><![CDATA[Elliptic Curve is supposed to be one of the most powerful weapons of modern mathematics. Basically Elliptic curve alongside Group theory has become the day to day language of a mathematicians of 20th and 21st century. The most notable use of Elliptic curves was done in Andrew Wiles proof of Fermat&#8217;s Last Theorem. Well, if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=163&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">Elliptic Curve is supposed to be one of the most powerful weapons of modern mathematics. Basically Elliptic curve alongside Group theory has become the day to day language of a mathematicians of 20th and 21st century. The most notable use of Elliptic curves was done in <a href="http://en.wikipedia.org/wiki/Andrew_Wiles">Andrew Wiles</a> proof of <a href="http://en.wikipedia.org/wiki/Fermat%27s_Last_Theorem">Fermat&#8217;s Last Theorem</a>. Well, if you dont know Andrew Wiles you should not be calling yourself a Mathematics lover. Even in his effort to <a href="http://en.wikipedia.org/wiki/P_versus_NP_problem">prove  P!=NP (though unsuccessful)</a> our very own <a href="http://www.hpl.hp.com/personal/Vinay_Deolalikar/">Vinay Deolalikar&#8217;s</a> tried to used elliptic cuves quite extensively.</p>
<p style="text-align:left;">It is that elliptic curve that are working with. We are trying to apply it in the field of Cryptography. But I feel we have failed to convince SKG sir with our procedings. Everyone asks &#8220;what new have you done?&#8221;. Actually we dont have anything new.Nor is it possible to have anything new so soon. If simply tampering of the problem in some way or the other  is to be called a new thing then we should really be sorry. I have talked with students from IITs,ISIs,IIITs,MIT. Even they  admit they don&#8217;t have mathematical depth to come up with new things as yet and we sitting here at IEM would invent new things every single day;what Mathematicians and Scientist are stuggling to find for  thousands of year we will will do that within a flash. Is it a joke or what? If such was the case then all the theorems of text books would have been  replaced by the names of IEMians instead of the Mathematician from the past.</p>
<br />Filed under: <a href='http://tessellationsoftechnology.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tessellationsoftechnology.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tessellationsoftechnology.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tessellationsoftechnology.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tessellationsoftechnology.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tessellationsoftechnology.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tessellationsoftechnology.wordpress.com/163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tessellationsoftechnology.wordpress.com/163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tessellationsoftechnology.wordpress.com/163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=163&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tessellationsoftechnology.wordpress.com/2010/11/26/invention-is-so-easy-isnt-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>22.605194 88.433901</georss:point>
		<geo:lat>22.605194</geo:lat>
		<geo:long>88.433901</geo:long>
		<media:content url="http://1.gravatar.com/avatar/7d3b1b447b8ec429be00d231c2360e9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ishandutta2007</media:title>
		</media:content>
	</item>
		<item>
		<title>The Theory behind Programming Contests</title>
		<link>http://tessellationsoftechnology.wordpress.com/2010/05/16/the-theory-behind-programming-contests/</link>
		<comments>http://tessellationsoftechnology.wordpress.com/2010/05/16/the-theory-behind-programming-contests/#comments</comments>
		<pubDate>Sun, 16 May 2010 01:21:53 +0000</pubDate>
		<dc:creator>ishandutta2007</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tessellationsoftechnology.wordpress.com/?p=135</guid>
		<description><![CDATA[Classical Problems: Graph Theory-These are the easier problems in a programming contest.The challenge lies in the ability to manage time and memory with choice and implementation of appropriate Data Structure. Number Theory-These are generally elementary but the toughest of all problems in any programming contest.By elementary what I mean is that the theory behind them [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=135&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3><strong> </strong><strong><strong>Classical Problems:</strong></strong></h3>
<p><strong><strong></strong><em>Graph Theory</em></strong>-These are the easier problems in a programming contest.The challenge lies in the ability to manage time and memory with choice and implementation of appropriate Data Structure.</p>
<p><strong><em>Number Theory</em></strong>-These are generally elementary but the toughest of all problems in any programming contest.By elementary what I mean is that the theory behind them is understandable even for a layman but are very difficult to reason out. They range from elementary gcd-lcm,factorization-primality,rationality-irrationality, divisibility-modularity to critical analysis of Diophantine equations.</p>
<p><strong><em>Group Theory</em></strong>-Group Theory is the language of modern mathematicians and Computer Scientists.Tough to comprehend but has revolutionary range of applications and one of the most powerful weapons of a programmer. Group Theory along with Graph Theory forms the basis of solution to most of the tough Combinatorics problems.</p>
<p><strong><em>Game Theory</em></strong>-Problems in game theory can range from easy to super tough ones.The hurdle is to identify the underlying problem from the complicated storyline or its application field&#8217;s description in the problem statement.</p>
<p><strong><em>Computational Geometry</em></strong>-Techniques(mostly polynomial time) devised to tackle problems which are not solvable in constant time i.e using classical geometry solely.Prerequisite is to have a good understanding of High School Geometry and their manipulation techniques in Cartesian and polar co-ordinate system and a bit of elementary trigonometry as well.Computational Geometry is an area where programmers are mostly found to lag in.</p>
<h3><strong><strong>Challenge Problems:</strong></strong></h3>
<p>These are basically Optimization problems for which no particular correct algorithm exits(or has not been discovered till date).These problems generally do not form a part of any on-spot programming contest.They are mainly for contests which span over a longer period of time.These problems can be from any active research areas.<br />
Sound knowledge of <strong><em>Calculus</em></strong>,<strong><em>Numerical Analysis</em></strong>, <strong><em>Probability</em></strong> ,<strong><em>Statistics</em></strong>, <strong><em>Fuzzy Logic</em></strong>,<strong><em>Neural Network</em></strong> and <strong><em>Artificial Intelligence</em></strong> comes in handy.</p>
<br />Filed under: <a href='http://tessellationsoftechnology.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tessellationsoftechnology.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tessellationsoftechnology.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tessellationsoftechnology.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tessellationsoftechnology.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tessellationsoftechnology.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tessellationsoftechnology.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tessellationsoftechnology.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tessellationsoftechnology.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=135&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tessellationsoftechnology.wordpress.com/2010/05/16/the-theory-behind-programming-contests/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>22.605194 88.433901</georss:point>
		<geo:lat>22.605194</geo:lat>
		<geo:long>88.433901</geo:long>
		<media:content url="http://1.gravatar.com/avatar/7d3b1b447b8ec429be00d231c2360e9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ishandutta2007</media:title>
		</media:content>
	</item>
		<item>
		<title>A book that you can madly fall in love with</title>
		<link>http://tessellationsoftechnology.wordpress.com/2010/02/19/a-book-that-you-can-madly-fall-in-love-with/</link>
		<comments>http://tessellationsoftechnology.wordpress.com/2010/02/19/a-book-that-you-can-madly-fall-in-love-with/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 03:24:08 +0000</pubDate>
		<dc:creator>ishandutta2007</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tessellationsoftechnology.wordpress.com/?p=112</guid>
		<description><![CDATA[The Art and Craft of Problem Solving The book doesn&#8217;t teach you how to get 4 by adding a two to another two, it makes you realize why the result is 4 and not 1 or 3. The books does not attempt to give you a collection of mind boggling problems. the book makes you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=112&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>The Art and Craft of Problem Solving</strong></p>
<p><a href="http://www.amazon.com/Art-Craft-Problem-Solving/dp/0471135712"><img class="aligncenter size-full wp-image-113" title="413Q8J34BFL._SS500_" src="http://tessellationsoftechnology.files.wordpress.com/2010/02/413q8j34bfl-_ss500_.jpg?w=570" alt=""   /></a></p>
<p>The book doesn&#8217;t teach you how to get 4 by adding a two to another two,<br />
it makes you realize why the result is 4 and not 1 or 3.<br />
The books does not attempt to give you a collection of mind boggling problems.<br />
the book makes you realize how our mind works to decide which is trivial and<br />
which is not or rather to be specific why it is not.It makes you realize why a same problem appears simple to one but super tough to another.<br />
in what different way do those two persons brain work.<br />
The book does not boost your mathematical knowledge.but it makes you think<br />
about the way you have been thinking for years.<br />
It gives wonderful names and similes to techniques that we have been using from<br />
our birth without actually being aware of it.<br />
I haven&#8217;t made much inroads into the book yet,I am only halfway through the book,<br />
but whatever little I have seen the book is bound to fill the heart of any<br />
scientifically thinking person with enormous joy.</p>
<br />Filed under: <a href='http://tessellationsoftechnology.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tessellationsoftechnology.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tessellationsoftechnology.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tessellationsoftechnology.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tessellationsoftechnology.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tessellationsoftechnology.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tessellationsoftechnology.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tessellationsoftechnology.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tessellationsoftechnology.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=112&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tessellationsoftechnology.wordpress.com/2010/02/19/a-book-that-you-can-madly-fall-in-love-with/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>22.605194 88.433901</georss:point>
		<geo:lat>22.605194</geo:lat>
		<geo:long>88.433901</geo:long>
		<media:content url="http://1.gravatar.com/avatar/7d3b1b447b8ec429be00d231c2360e9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ishandutta2007</media:title>
		</media:content>

		<media:content url="http://tessellationsoftechnology.files.wordpress.com/2010/02/413q8j34bfl-_ss500_.jpg" medium="image">
			<media:title type="html">413Q8J34BFL._SS500_</media:title>
		</media:content>
	</item>
		<item>
		<title>Mini Games</title>
		<link>http://tessellationsoftechnology.wordpress.com/2010/01/26/mini-games/</link>
		<comments>http://tessellationsoftechnology.wordpress.com/2010/01/26/mini-games/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 18:48:51 +0000</pubDate>
		<dc:creator>ishandutta2007</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tessellationsoftechnology.wordpress.com/?p=98</guid>
		<description><![CDATA[Here are a couple of games that I had made some times back.These are nothing but plain programs in  Turbo C.No help of graphics has been taken.Download and play and feel free to comment on the run-time errors that you may encounter or anything about them. PINGPONG TETRIS Posted in Uncategorized<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=98&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are a couple of games that I had made some times back.These are nothing but plain programs in  Turbo C.No help of graphics has been taken.Download and play and feel free to comment on the run-time errors that you may encounter or anything about them.</p>
<p><a href="http://rapidshare.com/files/341488300/PINGPONG.rar.html">PINGPONG</a><a href="http://rapidshare.com/files/341488301/TETRIS.rar.html"><br />
TETRIS</a></p>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tessellationsoftechnology.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tessellationsoftechnology.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tessellationsoftechnology.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tessellationsoftechnology.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tessellationsoftechnology.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tessellationsoftechnology.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tessellationsoftechnology.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tessellationsoftechnology.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=98&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tessellationsoftechnology.wordpress.com/2010/01/26/mini-games/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>22.605194 88.433901</georss:point>
		<geo:lat>22.605194</geo:lat>
		<geo:long>88.433901</geo:long>
		<media:content url="http://1.gravatar.com/avatar/7d3b1b447b8ec429be00d231c2360e9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ishandutta2007</media:title>
		</media:content>
	</item>
		<item>
		<title>SPOJ 3407. Candy</title>
		<link>http://tessellationsoftechnology.wordpress.com/2010/01/18/spoj-3407-candy/</link>
		<comments>http://tessellationsoftechnology.wordpress.com/2010/01/18/spoj-3407-candy/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 13:18:35 +0000</pubDate>
		<dc:creator>ishandutta2007</dc:creator>
				<category><![CDATA[Combinatorics and Graph Theory]]></category>

		<guid isPermaLink="false">http://tessellationsoftechnology.wordpress.com/?p=60</guid>
		<description><![CDATA[Here I come up with yet another SPOJ Problem. This problem appeared in my college&#8217;s tech fest&#8217;s programming contest(Code d basiCs). This is a lot simpler and smaller problem than my last post&#8217;s problem. Problem code: SAMER08C Little Charlie is a nice boy addicted to candies. He is even a subscriber to All Candies Magazine [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=60&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Here I come up with yet another SPOJ Problem. This problem appeared in my college&#8217;s tech fest&#8217;s programming contest(<em>C</em></strong><em>ode d basi<strong>C</strong>s</em><strong>). This is a lot simpler and smaller problem than my last post&#8217;s problem.</strong></p>
<p><strong>Problem code: SAMER08C </strong></p>
<p>Little Charlie is a nice boy addicted to candies. He is even a subscriber to All Candies Magazine and was selected to participate in the International Candy Picking Contest.</p>
<p>In this contest a random number of boxes containing candies are disposed in <em>M</em> rows with <em>N</em> columns each (so, there are a total of <em>M</em> ×<em>N</em> boxes). Each box has a number indicating how many candies it contains.</p>
<p>The contestant can pick a box (any one) and get all the candies it contains. But there is a catch (there is always a catch): when choosing a box, all the boxes from the rows immediately above and immediately below are emptied, as well as the box to the left and the box to the right of the chosen box. The contestant continues to pick a box until there are no candies left.</p>
<p>The figure bellow illustrates this, step by step. Each cell represents one box and the number of candies it contains. At each step, the chosen box is circled and the shaded cells represent the boxes that will be emptied. After eight steps the game is over and Charlie picked 10+9+8+3+7+6+10+1 = 54 candies.</p>
<h3><a href="http://tessellationsoftechnology.files.wordpress.com/2010/01/disatoba-candy1.png"><img class="aligncenter size-full wp-image-79" title="disatoba candy" src="http://tessellationsoftechnology.files.wordpress.com/2010/01/disatoba-candy1.png?w=570" alt=""   /></a></h3>
<p>For small values of <em>M</em> and <em>N</em>, Charlie can easily find the maximum number of candies he can pick, but when the numbers are really large he gets completely lost. Can you help Charlie maximize the number of candies he can pick?</p>
<h3>Input</h3>
<p>The input contains several test cases. The first line of a test case contains two positive integers <em>M</em> and <em>N</em> (1 ≤ <em>M</em> ×<em>N</em> ≤ 10<sup>5</sup>), separated by a single space, indicating the number of rows and columns respectively. Each of the following <em>M</em> lines contains <em>N</em> integers separated by single spaces, each representing the initial number of candies in the corresponding box. Each box will have initially at least 1 and at most 10<sup>3</sup> candies.</p>
<p>The end of input is indicated by a line containing two zeroes separated by a single space.</p>
<h3>Output</h3>
<p>For each test case in the input, your program must print a single line, containing a single value, the integer indicating the maximum number of candies that Charlie can pick.</p>
<h3>Example</h3>
<pre><strong>Input:</strong>

5 5
1 8 2 1 9
1 7 3 5 2
1 2 10 3 10
8 4 7 9 1
7 1 3 1 6
4 4
10 1 1 10
1 1 1 1
1 1 1 1
10 1 1 10
2 4
9 10 2 7
5 1 1 5
0 0

<strong>Output:</strong>
54
40
17</pre>
<hr size="2" />
<table border="0" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td>Added by:</td>
<td><a href="http://www.spoj.pl/users/disatoba">Diego Satoba</a></td>
</tr>
<tr>
<td>Date:</td>
<td>2008-11-23</td>
</tr>
<tr>
<td>Time limit:</td>
<td>2s</td>
</tr>
<tr>
<td>Source limit:</td>
<td>50000B</td>
</tr>
<tr>
<td>Languages:</td>
<td>C C++ 4.0.0-8 C++ 4.3.2 TCL SCALA JAVA PYTH   2.6.2</td>
</tr>
<tr>
<td>Resource:</td>
<td>South American Regional Contests 2008</td>
</tr>
</tbody>
</table>
<hr size="2" />______________________________________________________________________________________________</p>
<p><strong>Solution:</strong></p>
<p>One can solve the game by making the computer play the game by selecting among all possible choices and then among the remaining ones. Finally output the case with least sum as the answer. If that was the desired solution certainly Charlie would not have asked us to write a program for him.</p>
<p>The most interesting part of the game is to spot the underlying problem which enables us to maximize the overall sum for the game. Did you find it? Not yet? Well then let me tell you, the problem simply requires us to find the sequence for maximum sum in a row such that no two numbers are consecutive. After we recognize the hidden problem this tricky looking game boils down to finding the numbers of a sequence which gives maximum sum and no two numbers are consecutive either. After that we do the same with the result of each row in vertical direction. So basically now we have extracted the entire hidden problem but it is not over yet, this problem itself can be a bit tricky. So let’s now concentrate on the problem at hand i.e.</p>
<p>To find the numbers from a  given sequence  such that it has a maximum sum and no two of the selected numbers are consecutive . (say the given list of numbers is <strong>a</strong><sub>0</sub> to <strong>a</strong><sub>n</sub>).</p>
<p><strong><span style="text-decoration:underline;">Approach 1</span></strong></p>
<p>We can keep picking non consecutive numbers until it is not possible to pick any more and then update the minimum sum found so far. This approach is correct but it runs in exponential time.</p>
<p><strong><span style="text-decoration:underline;">Approach 2</span></strong></p>
<p>Now if we split the series in two series on either side of a randomly chosen number in a way such that we have maximum sum from the series on both sides of this number and this number which splits the series into two is not selected in any of the two series. Then it satisfies our criteria. The problem which arises here is, splitting along which number we can always have the maximum sum on either side is not known to us.<sub> </sub></p>
<p>One can implement dynamic programming with the following recurrence relation:</p>
<p><sub> k=j</sub></p>
<p>For i&lt;j, S(i,j)=Min<sub>k=i</sub> {S(i,k-1)+S(k+1,j)};……………(2.1)</p>
<p>For i=j, S(i,j)=S(i,i)=a<sub>i</sub>; ………………(2.2)</p>
<p>For i&gt;j, S(i,j)=0 ; ……………..(2.3)</p>
<p>This looks to be a perfect implementation of dynamic programming but the bad news is it does not satisfy the time constraint of the problem. It runs in O(n*n*n) ………………&#8230;(2,4)</p>
<p>It is a pitfall i have dragged you into. So we need a better one.</p>
<p><strong><span style="text-decoration:underline;">Approach 3</span></strong></p>
<p>Actually the problem is not so complex.</p>
<p>Note, when a number is selected for partitioning at some other point it would need us to check this numbers selection again about some other partitioning. Therefore we still have over-lapping sub-cases.We have used dynamic programming and yet we have not been able to avoid re-computation completely. Isn’t it? Now note, we can not have 3 consecutive unselected numbers. There should be at least 1 and at most 2 not selected among those 3 consecutive numbers.but we didn&#8217;t utilize this property.<strong><span style="text-decoration:underline;"> </span></strong></p>
<p>So When we chose a number randomly the question is why should we check iteratively all n such numbers to find which correctly splits the series when it can be decided among 3.It suffice to check immediate neighbors only(the one preceding and the one succeeding). The problem is that the way we defined our recurrence relation we did not leave any scope to know the status of the two neighbors (not even 1 neighbor).</p>
<p>Now check this recurrence definition where S(i) denote the sum max sum series from a<sub>0</sub> to a<sub>i</sub>.</p>
<p>S(i)=Max{S(i-2) +a<sub>i</sub>, S(i-1)} [ for 2&lt;=i&lt;=n-1 ]………….……(3.1)</p>
<p>S(0)=a<sub>0 </sub>….……………………(3.2)</p>
<p>S(1)=Max{a<sub>1</sub>,a<sub>0</sub>} ………………………(3.3)</p>
<p>Answer=Max{S(n-2),S(n-1)} ……………………&#8230;&#8230;.…(3.4)</p>
<p>Applying dynamic programming on this recurrence takes a time O(n)</p>
<p>Now returning back to Charlie’s game, for m rows it would take O(m*n) time plus time to compute vertically O(m).i.e. O(m*n)………&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..…(3.5)</p>
<p>This algorithm scores full marks. Readers please help me optimize it further.</p>
<br />Posted in Combinatorics and Graph Theory  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tessellationsoftechnology.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tessellationsoftechnology.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tessellationsoftechnology.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tessellationsoftechnology.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tessellationsoftechnology.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tessellationsoftechnology.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tessellationsoftechnology.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tessellationsoftechnology.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=60&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tessellationsoftechnology.wordpress.com/2010/01/18/spoj-3407-candy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>22.605194 88.433901</georss:point>
		<geo:lat>22.605194</geo:lat>
		<geo:long>88.433901</geo:long>
		<media:content url="http://1.gravatar.com/avatar/7d3b1b447b8ec429be00d231c2360e9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ishandutta2007</media:title>
		</media:content>

		<media:content url="http://tessellationsoftechnology.files.wordpress.com/2010/01/disatoba-candy1.png" medium="image">
			<media:title type="html">disatoba candy</media:title>
		</media:content>
	</item>
		<item>
		<title>SPOJ 3551. IOI05 Garden</title>
		<link>http://tessellationsoftechnology.wordpress.com/2010/01/17/spoj-3551-ioi05-garden/</link>
		<comments>http://tessellationsoftechnology.wordpress.com/2010/01/17/spoj-3551-ioi05-garden/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 01:46:07 +0000</pubDate>
		<dc:creator>ishandutta2007</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://tessellationsoftechnology.wordpress.com/?p=9</guid>
		<description><![CDATA[Questions that should come to mind:

   1. Why are we having to count a single rose every time for all w*l*w*l rectangles?
   2. How have we utilized the fact that the two rectangles will be disjoint?
   3. Why do we have to have to traverse through entire side of a line just for altering the line one place to the right or left we must prevent recalculation of those rectangles already found. Don’t we?
   4. What about those rectangles of k roses within another rectangle of k roses. They both must have the same k roses which all must lie in the interior most rectangle of k roses. Then why are we calculating. The innermost must have the minimum perimeter. Isn’t it?

Their answers are the following tricks that we applied:

   1. Dynamic Programming to pre-compute number of roses.
   2. Separating Lines concept
   3. Memorization List
   4. Contraction &#38; Expansion of rectangle along a particular axis with size constraint. <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=9&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>This is a SPOJ Problem. Here is the solution. It is for readers to optimize it further or give me better alternative means. Let’s take a look at the problem first.</h3>
<p>Problem code: BGARDEN</p>
<table style="height:32px;" border="0" cellpadding="0" width="733">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>
<p>Byteman owns the most beautiful garden in Bytetown. He planted n roses in his garden. Summer has come and the flowers have grown big and beautiful. Byteman has realized that he is not able to take care of all the roses on his own. He has decided to employ two gardeners to help him. He wants to select two rectangular areas, so that each of the gardeners will take care of the roses inside one area. The areas should be disjoint and each should contain exactly k roses. Byteman wants to make a fence surrounding the rectangular areas, but he is short of money, so he wants to use as little fence as possible. Your task is to help Byteman select the two rectangular areas.</p>
<p>The garden forms a rectangle l meters long and w meters wide. It is divided into l ·w squares of size 1 meter × 1 meter each. We fix a coordinate system with axes parallel to the sides of the garden. All squares have integer coordinates ( x,y) satisfying 1 ≤ x ≤ l, 1 ≤ y ≤ w. Each square may contain any number of roses.</p>
<p>The rectangular areas, which must be selected, should have their sides parallel to the sides of the garden and the squares in their corners should have integer coordinates. For 1 ≤l<sub>1</sub> ≤l<sub>2</sub> ≤l and 1 ≤w<sub>1</sub> ≤w<sub>2</sub> ≤w, a rectangular area with corners ( l<sub>1</sub>,w<sub>1</sub>), ( l<sub>1</sub>,w<sub>2</sub>), ( l<sub>2</sub>,w<sub>1</sub>) and ( l<sub>2</sub>,w<sub>2</sub>):</p>
<ul>
<li>contains all the squares with      coordinates ( x,y) satisfying l<sub>1</sub> ≤ x ≤ l<sub>2</sub> and w<sub>1</sub> ≤ y ≤ w<sub>2</sub>, and</li>
<li>has perimeter 2 ·( l<sub>2</sub> &#8211; l<sub>1</sub> +1)+2 ·(w<sub>2</sub>-w<sub>1</sub> +1).</li>
</ul>
<p>The two rectangular areas must be disjoint, that is they cannot contain a common square. Even if they have a common side, or part of it, they must be surrounded by separate fences.</p>
<h3>Task</h3>
<p>Write a program, that:</p>
<ul>
<li>reads from the standard input      the dimensions of the garden, the number of roses in the garden, the      number of roses that should be in each of the rectangular areas, and the      positions of the roses,</li>
<li>finds the corners of two such      rectangular areas with minimum sum of perimeters that satisfy the given      conditions,</li>
<li>writes to the standard output      the minimum sum of perimeters of two non-overlapping rectangular areas,      each containing exactly the given number of roses (or a single word NO, if      no such pair of areas exists).</li>
</ul>
<h3>Input</h3>
<p>The first line of standard input contains two integers: l and w (1 ≤ l,w ≤ 250 ) separated by a single space — the length and the width of the garden. The second line contains two integers: n and k (2 ≤ n ≤ 5000 , 1 ≤ k ≤ n/2 ) separated by a single space — the number of roses in the garden and the number of roses that should be in each of the rectangular areas. The following n lines contain the coordinates of the roses, one rose per line. The ( i+2)<sup>nd</sup> line contains two integers l<sub>i</sub>, w<sup>i</sup> (1 ≤ l<sub>i</sub> ≤ l, 1 ≤ w<sub>i</sub> ≤ w) separated by a single space — the coordinates of the square containing the i<sup>th</sup> rose. Two or more roses can occur in the same square.</p>
<p>In 50% of test cases, the dimensions of the garden will satisfy l,w ≤ 40 .</p>
<h3>Output</h3>
<p>The standard output should contain only one line with exactly one integer — the minimum sum of perimeters of two non-overlapping rectangular areas, each containing exactly k roses, or a single word NO, if no such pair of areas exists.</p>
<h3>Example</h3>

<a href='http://tessellationsoftechnology.wordpress.com/2010/01/17/spoj-3551-ioi05-garden/bgarden/' title='BGARDEN'><img data-attachment-id='54' data-orig-size='297,269' data-liked='0'width="150" height="135" src="http://tessellationsoftechnology.files.wordpress.com/2010/01/bgarden.jpg?w=150&#038;h=135" class="attachment-thumbnail" alt="BGARDEN" title="BGARDEN" /></a>

<p><img src="/Users/ishan/AppData/Local/Temp/moz-screenshot.jpg" alt="" /></p>
<pre><strong>For the input data:</strong>
6 5
7 3
3 4
3 3
6 1
1 1
5 5
5 5
3 1
<strong>the correct result is:</strong>
22
1 2 3 4 5 6
1
2
3
4
5</pre>
<hr size="2" />
<table border="0" cellspacing="0" cellpadding="0" width="492" align="left">
<tbody>
<tr>
<td>Added by:</td>
<td width="409"><a href="http://www.spoj.pl/OI/users/paulmcvn">Ngô   Minh Đức</a></td>
</tr>
<tr>
<td>Date:</td>
<td width="409">2008-12-18</td>
</tr>
<tr>
<td>Time limit:</td>
<td width="409">0.5s</td>
</tr>
<tr>
<td>Source limit:</td>
<td width="409">50000B</td>
</tr>
<tr>
<td>Languages:</td>
<td width="409">All except: C++ 4.3.2 TCL SCALA PYTH 2.6.2   ERL TECS JS</td>
</tr>
<tr>
<td>Resource:</td>
<td width="409">IOI 2005 – Poland</td>
</tr>
</tbody>
</table>
<p><strong>____________________________________________________________</strong></p>
<p><strong>Solutions:</strong></p>
<p><strong>All through the solution I have used the array notation rather than the Cartesian co-ordinate convention of the problem statement.</strong></p>
<p><span style="text-decoration:underline;">ALGORITHM 1A</span></p>
<p>The first thing that comes to mind is to apply brute force to find the minimum perimeter by checking all the (w*l)*(w*l) rectangles (i.e. we can find top left corner in w*l ways and bottom right corner in w*l ways) and to count the number of roses in each of those rectangles it takes time proportional to further w*l.<br />
thereby taking a total time of O(w*w*w*l*l*l)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. (1.1)<br />
we can find the least among them in O(w*w*l*l)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.(1.2)<br />
thereby effective time= w*w*w*l*l*l + w*w*l*l .<br />
i.e. O(w*w*w*l*l*l)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..(1.3)<br />
<span style="text-decoration:underline;"><br />
ALGORITHM 1B</span></p>
<p>Are we done? We have just calculated minimum perimeter of a rectangle containing exactly k roses.<br />
But in the problem statement we are asked to find two disjoint (non-overlapping) rectangles having exactly k roses such that their sum of perimeters is least. So didn’t we just goof up? Didn’t we end up calculating something not required. Let’s now proceed towards what we think is required for the given problem.<br />
So among w*w*l*l rectangles we can find the two rectangles having exactly k roses each with least sum of perimeters among all non-intersecting pair of rectangles in<br />
O((w*w*l*l)*(w*w*l*l))&#8230;..……………………&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. (1.4)<br />
(i.e. selection of two objects among n objects in done in nC2 ways i.e.O(n*n),here the number of objects is w*l*w*l rectangles)</p>
<p>thereby effective time= w*w*w*l*l*l + w*w*w*w*l*l*l*l .<br />
i.e. O(w*w*w*w*l*l*l*l)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. (1.5)<br />
This makes a horribly poor time complexity.</p>
<p><span style="text-decoration:underline;"><br />
ALGORITHM 2</span></p>
<p>Careful observations can lead to a much better result.</p>
<p>Firstly we don’t need to count the number of roses in a given rectangle traversing through the entire rectangle every single time only if we pre compute it dynamically.<br />
If R(r1,c1,r2,c2) — the number of roses in a rectangular region with corners (r1,c1) and (r2,c2) is:<br />
R(r1,c1,r2,c2) = R(r2,c2) − R(r2,c1−1)− R(r1−1,y2) + R(r1−1,c1−1) …………………………………………(2.1)</p>
<p>The pre-computation matrix form the above recurrence relation is dynamically generated in O(w*l )&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.(2.2).<br />
Thus time for rose counting operation for a rectangle reduces down from O(w*l) to O(1) &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..(2.3)<br />
and time for counting for all (w*l)*(w*l) rectangles reduces from O(w*w*w*l*l*l) to O(w*w*l*l)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.(2.4)<br />
effective time= (w*l+w*w*l*l) + w*w*w*w*l*l*l*l .<br />
i.e. O(w*w*w*w*l*l*l*l)&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..(2.5)<br />
However the above trick of introducing dynamic programming does not reduce our time as the time complexity of the algorithm is dominated by the last term(i.e. finding of two rectangles with least sum of perimeters among all non-intersecting pair of rectangles)</p>
<p><span style="text-decoration:underline;">ALGORITHM 3<br />
</span><br />
This can make the improvement in ALGORITHM 2 look useless as it eventually results in the same time complexity as ALGORITHM 1B.To make our effort of trickily implementing dynamic programming to compute the number of roses in a given rectangle not go in vain we need to reduce the time of finding of two rectangles with least sum of perimeters among all non-intersecting pair of rectangles too.</p>
<p>The first part of observation is if the rectangles are non-overlapping then there must be a line separating them(either horizontal or vertical).So we are no longer required to find disjoint pair of rectangle among (w*l)*(w*l) rectangles. We now just have to find least perimeter rectangle containing exactly k roses on either side of this line and then add the two. We have to do this for all l-1+w-1 such lines and find which of these l-1+w-1 cases yields a minimum.<br />
So finding rectangle of least perimeter containing k roses algorithm from ALGORITHM 1A and counting of roses in a given rectangle from ALGORITHM 2 we have,<br />
effective time= (w*l+w*l*w*l) + w*w*l*l*(w+l).<br />
i.e. O(w*w*l*l*(w+l))&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..(3.1)<br />
Still the 2<sup>nd</sup> part of the time complexity equation dominates but we have reduced it significantly from O(w*w*w*l*l*l) to O(w*w*l*l*(w+l))&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..(3.2)</p>
<p>&lt;&lt;<strong>Note</strong>:-did you notice how finding of rectangle having the least perimeter with k roses comes into play. when we initially did that in ALGORITHM 1A it looked so irrelevant but now the more formidable idea of considering two rectangles with least sum of perimeters among all non-intersecting pair of rectangles is no longer being considered a good idea&gt;&gt;<br />
<span style="text-decoration:underline;"><br />
ALGORITHM 4</span></p>
<p>Every time we are selecting a line we are having to check for all possible rectangles on either side of the line cant we optimize it any further. The answer is yes we can look whenever we are shifting a line to its next line we are checking a large number of rectangles many of which are same as that we found for the last line. So don’t you think we are unnecessarily rechecking them? Here again to avoid re-computation we can take the help of dynamic programming. Let’s see how. I wont call it dynamic programming as we are not having any recurrence relation to work with but we know there are something common for two or more line and that re-computation needs to be avoided. So we need some sort of relation.</p>
<p>Observe carefully, say we have a line next to r, let’s consider the lower part of r. So we have to find all possible rectangles whose one line(take it to be upper line) must be lying among one of the lines r+1, r+2,….,l.</p>
<p>If  we define MD(r) as the <span style="text-decoration:underline;">M</span>inimum Perimeter rectangle of k rose <span style="text-decoration:underline;">D</span>own of Row r and MSR(r<sub>i</sub>) as the <span style="text-decoration:underline;">M</span>inimum Perimeter rectangle of k rose with the <span style="text-decoration:underline;">S</span>tarting side exactly along i<sup>th</sup> <span style="text-decoration:underline;">R</span>ow.()</p>
<p>Then we have MD(r) = min {MSR(r+1), MSR(r+2)…, MSR(l)}….(4.1)</p>
<p>Similarly we can have MU, MR, ML and analogously MER,MSC,MEC</p>
<p>Now let’s discuss how to make use of such a relation. For that we use a kind of memorization. Lets set the 4 lists MSR,MER,MSC and MEC initially to infinity. Now we just traverse once (i.e. consider all w*l*w*l rectangles) and update these 4 lists accordingly. This operation takes only time of O(w*l*w*l)…………………………………………………(4.2)</p>
<p>For a given line we can get the least perimeter k rose containing rectangle from its respective list just in linear time i.e. O(l) or O(w)…………(4.3)</p>
<p>Considering all lines effective time is O(l*l+w*w)…………………(4.4)</p>
<p>After incorporation of this idea of memorization into our algorithm</p>
<p>effective time = (w*l+w*w*l*l) + {w*w*l*l +( l*l +w*w)}</p>
<p>i.e. O(w*w*l*l)………………………………………………………(4.5)</p>
<p><span style="text-decoration:underline;"><br />
ALGORITHM 5</span></p>
<p>Now here is a point worth noting. Interestingly if we see very carefully observe we can find that we do not need to consider all rectangles having exactly k roses.<br />
We can restrict our considerations to only those rectangles having exactly k roses which do not contain any other rectangles having exactly K roses in their interiors. So here we incorporate our <sup>4th</sup> trick.</p>
<p>Let us consider a case for a given r1 and r2.Say suppose we have found</p>
<p>Case1:R(r1, c1, r2, c2) =k then we have found a required rectangle and we are sure that for minimum perimeter and for a given r1 and r2 the value c2-c1 can not be any greater but it may not be lesser. So there is no point in incrementing c2 for same c1.so we increment c1 (trying to find smaller rectangles with k roses) keeping</p>
<p>Case2:R(r1, c1, r2, c2) &gt;k then is a chance of finding a rectangle in its interior with exactly k rosés. We contract the rectangle by incrementing c1 (why did not we contract by decreasing c2? because that case has already been considered)</p>
<p>Case3:R(r1, c1, r2, c2) &lt;k then there is no point decreasing c2-c1 value further because if this rectangle does not have k roses then there is no way a rectangle interior to it will  have k roses we increase c2 to make the rectangle bigger.</p>
<p>In this entire algorithm we either increment c1 or c2 until c2&gt;w</p>
<p>So it takes a linear time i.e. O(w)…………………………………(5.1)</p>
<p>But remind u, we have done this calculation for a given r1 and r2.</p>
<p>Now we have to consider all pair of r1 and r2 which takes O(l*l)……&#8230;&#8230;..(5.2)</p>
<p>As for a given rectangle number of roses can be found in O(1) [from equation 2.2]time we are not required to check no of roses for all possible w*w*l*l. We will only retrieve the number of rose information in O(1) time and that time will be proportional to the number of rectangles taken up for consideration i.e.O(w*l*l)…………………………………………………………(5.3)</p>
<p>Effective time = (w*l+w*l*l) + {w*l*l + (l*l +w*w)} i.e.O(w*l*l)………………………………………………………..(5.4)</p>
<p>&lt;&lt;<strong>note</strong>: in both case1 and we increment c1 the only difference is in case1 we update the memorization list values i.e. MPSC(c1) , MPEC(c2), MPSR(r1) and MPER(r2)  before shifting the starting column c1 rightward&gt;&gt;</p>
<p>Questions that should come to mind:</p>
<ol>
<li>Why are we having to count a      single rose every time for all w*l*w*l rectangles?</li>
<li>How have we utilized the fact      that the two rectangles will be disjoint?</li>
<li>Why do we have to have to      traverse through entire side of a line just for altering the line one      place to the right or left we must prevent recalculation of those      rectangles already found. Don’t we?</li>
<li>What about those rectangles      of k roses within another rectangle of k roses. They both must have the      same k roses which all must lie in the interior most rectangle of k roses.      Then why are we calculating. The innermost must have the minimum      perimeter. Isn’t it?</li>
</ol>
<p>Their answers are the following tricks that we applied:</p>
<ol>
<li>Dynamic Programming to      pre-compute number of roses.</li>
<li>Separating Lines concept</li>
<li>Memorization List</li>
<li>Contraction &amp; Expansion      of rectangle along a particular axis with size constraint.</li>
</ol>
<br />Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tessellationsoftechnology.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tessellationsoftechnology.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tessellationsoftechnology.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tessellationsoftechnology.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tessellationsoftechnology.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tessellationsoftechnology.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tessellationsoftechnology.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tessellationsoftechnology.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tessellationsoftechnology.wordpress.com&amp;blog=11406641&amp;post=9&amp;subd=tessellationsoftechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tessellationsoftechnology.wordpress.com/2010/01/17/spoj-3551-ioi05-garden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>22.605194 88.433901</georss:point>
		<geo:lat>22.605194</geo:lat>
		<geo:long>88.433901</geo:long>
		<media:content url="http://1.gravatar.com/avatar/7d3b1b447b8ec429be00d231c2360e9e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ishandutta2007</media:title>
		</media:content>

		<media:content url="http://tessellationsoftechnology.files.wordpress.com/2010/01/bgarden.jpg?w=150" medium="image">
			<media:title type="html">BGARDEN</media:title>
		</media:content>
	</item>
	</channel>
</rss>
