<?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/"
	>

<channel>
	<title>cassiechen.com</title>
	<atom:link href="http://cassiechen.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cassiechen.com</link>
	<description></description>
	<lastBuildDate>Thu, 09 Feb 2012 03:57:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Jan-2012</title>
		<link>http://cassiechen.com/2012/02/jan-2012/</link>
		<comments>http://cassiechen.com/2012/02/jan-2012/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 03:57:30 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Diary]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=445</guid>
		<description><![CDATA[一月份就这么没了，瞬间没了。。我感觉我前天才回来的。今天怎么都要2月中了 =.=&#124;&#124; 最近还是算比较忙的，没想过弄一个网站可以刷paypal的东西还有这么多讲究。。 好久没碰HTML了，啊哈哈，上个礼拜改公司网站，弄个啥都要google。。。 看来还是不能再用写字板这种东西做网页了=.=&#124;&#124; 我得弄个盗版DW去。。。 最近看了 Terra Nova，还有Becoming Bad， 好好看啊。。尤其是Terra Nova结尾的时候，第二季什么时候才能上啊。。等不及他们去badlands啦。。 dodo过来澳洲了，在我心里如同大神般的人物-_- 怪不得我妈天天用他教育我了。。。人家真用工啊。。跟他比起来我真不是人啊=.= 文凭吗，拿到手就行了， 既然做不到那种95%以上拿校长奖章的人。。 那平均分80跟50，我是真看不出来太大区别了。。 我又开始自己安慰自己了哈~ 集装箱明天到港口了，我空闲的日子估计也不是特别多了。 能拖的都拖到最后不做不行了&#8230; 估计马上要忙起来咯。。。 还有要记下来的就是上个月买了个电视， 三星一个巨大的LED 电视啊，哇哈哈哈，46寸哒，看起来老爽了。 我唠叨完了。 &#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>一月份就这么没了，瞬间没了。。我感觉我前天才回来的。今天怎么都要2月中了 =.=||</p>
<p>最近还是算比较忙的，没想过弄一个网站可以刷paypal的东西还有这么多讲究。。 好久没碰HTML了，啊哈哈，上个礼拜改公司网站，弄个啥都要google。。。 看来还是不能再用写字板这种东西做网页了=.=|| 我得弄个盗版DW去。。。</p>
<p>最近看了 Terra Nova，还有Becoming Bad， 好好看啊。。尤其是Terra Nova结尾的时候，第二季什么时候才能上啊。。等不及他们去badlands啦。。</p>
<p>dodo过来澳洲了，在我心里如同大神般的人物-_- 怪不得我妈天天用他教育我了。。。人家真用工啊。。跟他比起来我真不是人啊=.= 文凭吗，拿到手就行了， 既然做不到那种95%以上拿校长奖章的人。。 那平均分80跟50，我是真看不出来太大区别了。。 我又开始自己安慰自己了哈~</p>
<p>集装箱明天到港口了，我空闲的日子估计也不是特别多了。 能拖的都拖到最后不做不行了&#8230; 估计马上要忙起来咯。。。</p>
<p>还有要记下来的就是上个月买了个电视， 三星一个巨大的LED 电视啊，哇哈哈哈，46寸哒，看起来老爽了。</p>
<p>我唠叨完了。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2012/02/jan-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>差不多3年过去了</title>
		<link>http://cassiechen.com/2011/12/%e5%b7%ae%e4%b8%8d%e5%a4%9a3%e5%b9%b4%e8%bf%87%e5%8e%bb%e4%ba%86/</link>
		<comments>http://cassiechen.com/2011/12/%e5%b7%ae%e4%b8%8d%e5%a4%9a3%e5%b9%b4%e8%bf%87%e5%8e%bb%e4%ba%86/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 04:58:36 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Diary]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=439</guid>
		<description><![CDATA[三年前，还是2年半以前，还是啥时候，我给自己写了一个日记，三年过后，我又看了一遍，发现我活的还是很幼稚。。 今年过年的时候,我跟交往了5年多的男朋友分手了,谢谢小J, Bx, ADAA, DD, 传哥,小月和2K,在这段时间一直不停的给我上课.去英国的这5年,经历了很多人一辈子都无法想象的事情.我想上帝能让我最终活着回到家,就还是很贴心的照顾了我的.我一直在抱怨我付出的一切都没有任何结果.是你们让我知道,就算是我这样的结局,我也收获了成长.看看年龄跟我差不多的你们,我想我是时候,要开始学着长大了. 过去的这些年里,我做了太多荒唐的事情.我很健忘,甚至撒谎都会撒的前后不连贯,可有些事不是说忘就能忘的.真希望可以跟上帝做笔生意,我愿意折寿20年,换来这5年的消失. 小J你又要怪我像个孩子了,提出这种过分的要求.请你原谅我,就让我再任性最后一次. 曾经在分手后的几天写了很多语言偏激的日记.这些天下来,发现自己不放手,永远也不可能长大. 我今后再也不会对以前的空间做任何update. 勇气.真的需要一生的积攒,才能得到. 今年的6月份,我会自己一个人飞往墨尔本.前些日子小J你问我,会不会害怕,我选择了像5年前一样的答案&#8221;这有什么可害怕的&#8221;.只是5年前是发自内心的,而现在,是骗人的. 你没有选择向5年前一样试图讲可怕的事情吓唬我,我知道你也理解我是在骗你.经历了英国的日子,你们都看出来,我像极了一个受惊的孩子,对所有事情都感到惊恐,也拒绝相信任何人.我很清楚,对你们来说,这是一种伤害.只是长大是需要时间的.我才刚刚开始努力. 这段时间,你们都以为我反常.其实不是.我打心底里很喜欢这样的日子. 明白自己在走怎样的一条路.并可以按照自己的想法,选择自己的时间,自己的地点,看自己喜欢看的风景.再选择自己觉得恰当的时间,重新启程. 2K,所有人里数你认识我的时间最短.所以有时候你并无法像小J和传哥一样理解我的变化.但我还是要说一声,我很感激你,可以为了我的幸福而发脾气. 最后一句话,留给我自己. 放下,才能担当,才能对自己付责任,才能长大. 3年了，我放弃了以前的qq号码，在踏上澳洲的土地上之后，再也没有跟任何人联系，只有传哥，还时不时聊一聊，问问我近况，传哥也结婚了，生了个胖娃娃，大家都很幸福，我也很幸福。 只是三年前的计划，要放下，要对生活有勇气，要走自己的路，要过自己的生活，我依旧没有做到。放不下，虽然装做无所谓过，依旧骗不过自己，我恨，不是恨他，是恨当初瞎了眼懦弱的自己。 我也还是一个无法对自己负责任的小孩子，我的很多行动依然是跟着直觉，完全不顾及后果，天真，极其幼稚。我也依旧是说着愿意折寿20年，换来那5年消失的小孩子。而事实是，随着时间的流逝，我越发清楚那5年对我的人生意味着什么，我知道我接下来的50年，都换不回那5年了。不过我有我可爱的宝贝了，他会牵着我的手，陪我重新走回正轨。 这3年的变化，我想就是现在我可以从心底里笑出来了，我每天都过的很开心，我也不再是三年前那个受惊的孩子，我跟宝贝一样有钢板一样的厚脸皮了。哇哈哈哈。。。。 不知道3年之后的我，再回国头来看这个日记，会是什么个情景。 希望那时候的我，能更成熟一点。]]></description>
			<content:encoded><![CDATA[<p>三年前，还是2年半以前，还是啥时候，我给自己写了一个日记，三年过后，我又看了一遍，发现我活的还是很幼稚。。</p>
<blockquote><p>今年过年的时候,我跟交往了5年多的男朋友分手了,谢谢小J, Bx, ADAA, DD, 传哥,小月和2K,在这段时间一直不停的给我上课.去英国的这5年,经历了很多人一辈子都无法想象的事情.我想上帝能让我最终活着回到家,就还是很贴心的照顾了我的.我一直在抱怨我付出的一切都没有任何结果.是你们让我知道,就算是我这样的结局,我也收获了成长.看看年龄跟我差不多的你们,我想我是时候,要开始学着长大了.</p>
<p>过去的这些年里,我做了太多荒唐的事情.我很健忘,甚至撒谎都会撒的前后不连贯,可有些事不是说忘就能忘的.真希望可以跟上帝做笔生意,我愿意折寿20年,换来这5年的消失.</p>
<p>小J你又要怪我像个孩子了,提出这种过分的要求.请你原谅我,就让我再任性最后一次.</p>
<p>曾经在分手后的几天写了很多语言偏激的日记.这些天下来,发现自己不放手,永远也不可能长大. 我今后再也不会对以前的空间做任何update.<br />
勇气.真的需要一生的积攒,才能得到.</p>
<p>今年的6月份,我会自己一个人飞往墨尔本.前些日子小J你问我,会不会害怕,我选择了像5年前一样的答案&#8221;这有什么可害怕的&#8221;.只是5年前是发自内心的,而现在,是骗人的. 你没有选择向5年前一样试图讲可怕的事情吓唬我,我知道你也理解我是在骗你.经历了英国的日子,你们都看出来,我像极了一个受惊的孩子,对所有事情都感到惊恐,也拒绝相信任何人.我很清楚,对你们来说,这是一种伤害.只是长大是需要时间的.我才刚刚开始努力.</p>
<p>这段时间,你们都以为我反常.其实不是.我打心底里很喜欢这样的日子. 明白自己在走怎样的一条路.并可以按照自己的想法,选择自己的时间,自己的地点,看自己喜欢看的风景.再选择自己觉得恰当的时间,重新启程.</p>
<p>2K,所有人里数你认识我的时间最短.所以有时候你并无法像小J和传哥一样理解我的变化.但我还是要说一声,我很感激你,可以为了我的幸福而发脾气.</p>
<p>最后一句话,留给我自己.</p>
<p>放下,才能担当,才能对自己付责任,才能长大.</p></blockquote>
<p>3年了，我放弃了以前的qq号码，在踏上澳洲的土地上之后，再也没有跟任何人联系，只有传哥，还时不时聊一聊，问问我近况，传哥也结婚了，生了个胖娃娃，大家都很幸福，我也很幸福。</p>
<p>只是三年前的计划，要放下，要对生活有勇气，要走自己的路，要过自己的生活，我依旧没有做到。放不下，虽然装做无所谓过，依旧骗不过自己，我恨，不是恨他，是恨当初瞎了眼懦弱的自己。</p>
<p>我也还是一个无法对自己负责任的小孩子，我的很多行动依然是跟着直觉，完全不顾及后果，天真，极其幼稚。我也依旧是说着愿意折寿20年，换来那5年消失的小孩子。而事实是，随着时间的流逝，我越发清楚那5年对我的人生意味着什么，我知道我接下来的50年，都换不回那5年了。不过我有我可爱的宝贝了，他会牵着我的手，陪我重新走回正轨。</p>
<p>这3年的变化，我想就是现在我可以从心底里笑出来了，我每天都过的很开心，我也不再是三年前那个受惊的孩子，我跟宝贝一样有钢板一样的厚脸皮了。哇哈哈哈。。。。</p>
<p>不知道3年之后的我，再回国头来看这个日记，会是什么个情景。</p>
<p>希望那时候的我，能更成熟一点。</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/12/%e5%b7%ae%e4%b8%8d%e5%a4%9a3%e5%b9%b4%e8%bf%87%e5%8e%bb%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>各种忙</title>
		<link>http://cassiechen.com/2011/12/%e5%90%84%e7%a7%8d%e5%bf%99/</link>
		<comments>http://cassiechen.com/2011/12/%e5%90%84%e7%a7%8d%e5%bf%99/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 08:25:33 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Diary]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=430</guid>
		<description><![CDATA[最近公司和自己品牌的事情逐渐走上了正规，各种包装盒，礼品袋，礼品盒，吊牌，水洗标，乱七八糟的，各种东西，也都订了下来。 自己干生意真是复杂啊，标签，连别吊牌的别针都要自己去订。。。。这么些年了，也没这么忙啊。。。 我爸说，上次你们就说弄公司，慢慢吞吞的不知道在干嘛，lol。。。我这不是懒吗～～ 这次公司注册了，商标申请了，订单也讨论的差不多了。厂长要被我们逼疯了。。 集装箱，清官，乱七八糟，上千样各种新东西，lol，学的也是头昏脑胀的。。下单的事也把我爸妈忙坏了。。。 集装箱的箱子也很麻烦，里面到底怎么堆，堆多少，什么地方正着放，什么地方转箱子等，才能放进去，弄得我头都大了。。 不过东西渐渐开始按起来像个样子了。超级有成就感的哇～～ 还有产品的吊牌，还有包装盒的设计，全是我来的哇，特别特别难啊～～超级难啊，还好姐聪明 -.-&#124;&#124; 木哈哈哈哈。。。 人说现在做生意，真正从0开始已经好难了，我总感觉脑子聪明的人，怎么做都能做下来的，看来不是-.- 这次碰壁碰的也太多了，起步资金定成10w RMB看来的确是太费劲了。。扣掉集装箱啊，车啊，税啊，等等的啊，竟然没几毛钱能用来真正下订单了。。。 什么布料厂啊，乱七八糟的，起订量都好大， 你说东西印个几十米，谁理你啊=.= 还有其他配件， 动不动起订就5000米。。。10000个的， wtf。。 10w RMB也算是从0开始了吧，如今这个年代。。这钱真的还没干啥就没了。。。 好难好难好难啊，最近好累。 我发现我睡觉都是倒下立刻能睡着了，以前熬夜，3－4点根本不叫熬夜啊，现在竟然11点就能睡着了。。。靠。。 公司这个事情，以后就是我负责弄货，宝贝负责卖货，本以为弄货这个事，肯定比卖东西要便宜的多，谁知道也这么烦。头都大了！！ 哎。。。 希望以后一些顺利哦。]]></description>
			<content:encoded><![CDATA[<p>最近公司和自己品牌的事情逐渐走上了正规，各种包装盒，礼品袋，礼品盒，吊牌，水洗标，乱七八糟的，各种东西，也都订了下来。<br />
自己干生意真是复杂啊，标签，连别吊牌的别针都要自己去订。。。。这么些年了，也没这么忙啊。。。</p>
<p>我爸说，上次你们就说弄公司，慢慢吞吞的不知道在干嘛，lol。。。我这不是懒吗～～</p>
<p>这次公司注册了，商标申请了，订单也讨论的差不多了。厂长要被我们逼疯了。。</p>
<p>集装箱，清官，乱七八糟，上千样各种新东西，lol，学的也是头昏脑胀的。。下单的事也把我爸妈忙坏了。。。</p>
<p>集装箱的箱子也很麻烦，里面到底怎么堆，堆多少，什么地方正着放，什么地方转箱子等，才能放进去，弄得我头都大了。。</p>
<p>不过东西渐渐开始按起来像个样子了。超级有成就感的哇～～</p>
<p>还有产品的吊牌，还有包装盒的设计，全是我来的哇，特别特别难啊～～超级难啊，还好姐聪明 -.-||  木哈哈哈哈。。。</p>
<p>人说现在做生意，真正从0开始已经好难了，我总感觉脑子聪明的人，怎么做都能做下来的，看来不是-.-  这次碰壁碰的也太多了，起步资金定成10w RMB看来的确是太费劲了。。扣掉集装箱啊，车啊，税啊，等等的啊，竟然没几毛钱能用来真正下订单了。。。 什么布料厂啊，乱七八糟的，起订量都好大， 你说东西印个几十米，谁理你啊=.=  还有其他配件， 动不动起订就5000米。。。10000个的， wtf。。</p>
<p>10w RMB也算是从0开始了吧，如今这个年代。。这钱真的还没干啥就没了。。。  </p>
<p>好难好难好难啊，最近好累。 我发现我睡觉都是倒下立刻能睡着了，以前熬夜，3－4点根本不叫熬夜啊，现在竟然11点就能睡着了。。。靠。。</p>
<p>公司这个事情，以后就是我负责弄货，宝贝负责卖货，本以为弄货这个事，肯定比卖东西要便宜的多，谁知道也这么烦。头都大了！！ 哎。。。</p>
<p>希望以后一些顺利哦。</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/12/%e5%90%84%e7%a7%8d%e5%bf%99/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>淘宝真是个好东西</title>
		<link>http://cassiechen.com/2011/11/%e6%b7%98%e5%ae%9d%e7%9c%9f%e6%98%af%e4%b8%aa%e5%a5%bd%e4%b8%9c%e8%a5%bf/</link>
		<comments>http://cassiechen.com/2011/11/%e6%b7%98%e5%ae%9d%e7%9c%9f%e6%98%af%e4%b8%aa%e5%a5%bd%e4%b8%9c%e8%a5%bf/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 11:59:16 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Diary]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=418</guid>
		<description><![CDATA[在澳洲kikki还是kitti还是tikki得一个文具店里=.= 反正我感觉东西跟typo差不多，见到过一次笔芯奇粗无比得彩色铅笔，还有银色金色得，写在黑色的纸上特别漂亮。。当时是5.5AUD一只吧，还卖断货了，我最后只买到了银色得。 这个笔是德国得lyra牌子得，特别特别好，回国就到淘宝转了一圈。。。 澳洲那个文具店 60澳币一套得笔，国内竟然129RMB lol？ 赶紧买多点，各种买，非常多种买，全买了，哇哈哈哈。 开心死我了。最近在花公司得logo，打算画上50个，回去给宝贝选。然后国内跟我爸底下得厂就下单子了，不知道能做出样子不，哈哈。 一年半以前，从墨尔本搬家到了悉尼，转学过来了，今天人事部经理找到我宝贝，说要给他调到墨尔本得总公司去。。。你折腾这么一大下子干什么呢。。。哎。。 公司说可以等我毕业再调过去，只要说调过去，他们就开始招人顶替我宝贝了。 我说肯定过去啊，我朋友都在墨尔本，而且我总感觉墨尔本得消费便宜一些。。 工资别说涨了，就是不涨，都跟涨了似的。。毕竟花销减少了吗哈哈。 哎。。又要大搬一次家啦半年后。 老爸老妈去了美国3个礼拜，又爱上美国了，就跟当初爱上澳洲一样。。现在天天跟我叨叨，说要让我陪他们再去一次。。。宝贝正好明年调到总部以前可以顺便请上一个月得假期，回来看一下爸妈，然后就可以飞美国了。 宝贝好了。。澳洲身份，网上online申请就结束了。。我国籍还是中国人。。无论是国内办还是国外办，都要面签。。tnnd。。。 既然明年年中要去美国，我看钻戒也是那时候买了。。哈哈，我以后可以天天盯着钻戒看了＝。＝ 不用盯着cartier得小盒子了。。 还有婴儿车。。澳洲stokke竟然卖到了1800AUD。。而且颜色还不能选，配件跟小伞也不是每家店都能买到。。美国才1049AUD，而且啥都有。。。靠。。。我去美国一定要抗一个宝宝婴儿车回来！]]></description>
			<content:encoded><![CDATA[<p>在澳洲kikki还是kitti还是tikki得一个文具店里=.= 反正我感觉东西跟typo差不多，见到过一次笔芯奇粗无比得彩色铅笔，还有银色金色得，写在黑色的纸上特别漂亮。。当时是5.5AUD一只吧，还卖断货了，我最后只买到了银色得。<br />
这个笔是德国得lyra牌子得，特别特别好，回国就到淘宝转了一圈。。。<br />
澳洲那个文具店 60澳币一套得笔，国内竟然129RMB lol？ 赶紧买多点，各种买，非常多种买，全买了，哇哈哈哈。<br />
开心死我了。最近在花公司得logo，打算画上50个，回去给宝贝选。然后国内跟我爸底下得厂就下单子了，不知道能做出样子不，哈哈。</p>
<p>一年半以前，从墨尔本搬家到了悉尼，转学过来了，今天人事部经理找到我宝贝，说要给他调到墨尔本得总公司去。。。你折腾这么一大下子干什么呢。。。哎。。 公司说可以等我毕业再调过去，只要说调过去，他们就开始招人顶替我宝贝了。 我说肯定过去啊，我朋友都在墨尔本，而且我总感觉墨尔本得消费便宜一些。。 工资别说涨了，就是不涨，都跟涨了似的。。毕竟花销减少了吗哈哈。 哎。。又要大搬一次家啦半年后。</p>
<p>老爸老妈去了美国3个礼拜，又爱上美国了，就跟当初爱上澳洲一样。。现在天天跟我叨叨，说要让我陪他们再去一次。。。宝贝正好明年调到总部以前可以顺便请上一个月得假期，回来看一下爸妈，然后就可以飞美国了。 宝贝好了。。澳洲身份，网上online申请就结束了。。我国籍还是中国人。。无论是国内办还是国外办，都要面签。。tnnd。。。</p>
<p>既然明年年中要去美国，我看钻戒也是那时候买了。。哈哈，我以后可以天天盯着钻戒看了＝。＝ 不用盯着cartier得小盒子了。。</p>
<p>还有婴儿车。。澳洲stokke竟然卖到了1800AUD。。而且颜色还不能选，配件跟小伞也不是每家店都能买到。。美国才1049AUD，而且啥都有。。。靠。。。我去美国一定要抗一个宝宝婴儿车回来！</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/%e6%b7%98%e5%ae%9d%e7%9c%9f%e6%98%af%e4%b8%aa%e5%a5%bd%e4%b8%9c%e8%a5%bf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Algorithms and Complexity &#8211; DP Max Weight Matching in Tree</title>
		<link>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-max-weight-matching-in-tree-latexlatex/</link>
		<comments>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-max-weight-matching-in-tree-latexlatex/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 01:07:50 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=358</guid>
		<description><![CDATA[Given: Tree , Want: Give poly-time algorithm for finding max weight matching Solve: cost of max weight matching for sub-tree rooted at root. Base case: when is a leaf node for internal node: case 1: is unmatched case 2: is matched to one of its children First, look at a sub-tree from , Case 1: ...]]></description>
			<content:encoded><![CDATA[<p><strong>Given:</strong><br />
Tree <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-77445b201b914e5a1a6e8c29627bda10_l3.png" class="ql-img-inline-formula" alt="&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-479bde70728cb5d57211f837b5d09a37_l3.png" class="ql-img-inline-formula" alt="&#119;&#58;&#69;&#92;&#82;&#105;&#103;&#104;&#116;&#97;&#114;&#114;&#111;&#119;&#32;&#92;&#109;&#97;&#116;&#104;&#98;&#98;&#123;&#82;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/><br />
<strong>Want:</strong><br />
Give poly-time algorithm for finding max weight matching<br />
<strong>Solve:</strong><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-93c02a9767ae686b8309a958fc9357af_l3.png" class="ql-img-inline-formula" alt="&#65;&#91;&#117;&#93;&#61;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>cost of max weight matching for sub-tree rooted at root.<br />
Base case:</p>
<ul>
<li><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-570ee2a2b7083615f13101d54172c166_l3.png" class="ql-img-inline-formula" alt="&#65;&#91;&#117;&#93;&#61;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> when <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is a leaf node</li>
<li>for internal node:</li>
<ul>
<li>case 1: <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is unmatched</li>
<li>case 2: <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is matched to one of its children</li>
</ul>
</ul>
<p>First, look at a sub-tree from <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-97fa7d280084bd1c339b7f44ef95f818_l3.png" class="ql-img-inline-formula" alt="&#114;&#111;&#111;&#116;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/></p>
<p class="ql-center-picture"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-d707cb7e4f94742669ece2b067a549be_l3.png"class="ql-img-picture"alt="Rendered by QuickLaTeX.com" title="Rendered by QuickLaTeX.com"/></p>
<p><strong>Case 1:</strong> when <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is not matched <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ec57fa5849250e2035fd845c497147ca_l3.png" class="ql-img-inline-formula" alt="&#92;&#114;&#105;&#103;&#104;&#116;&#97;&#114;&#114;&#111;&#119;&#32;&#65;&#91;&#117;&#93;&#61;&#92;&#115;&#117;&#109;&#95;&#123;&#118;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#117;&#125;&#125;&#65;&#91;&#118;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/>, this means its children must all match to some of their children. Look at the thick edges.</p>
<p class="ql-center-picture"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-0d0067feaf124861c311754d836f6671_l3.png"class="ql-img-picture"alt="Rendered by QuickLaTeX.com" title="Rendered by QuickLaTeX.com"/></p>
<p>Case 2: when <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is matched to <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-4ae0832a87d9eac6c60371b2199b4689_l3.png" class="ql-img-inline-formula" alt="&#118;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> so</p>
<p style="text-align: center;"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-3b2f8c2f9894f7cd0ba1aaa0d3be852a_l3.png" class="ql-img-inline-formula" alt="&#65;&#91;&#117;&#93;&#61;&#109;&#97;&#120;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#97;&#115;&#101;&#32;&#49;&#125;&#43;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#97;&#115;&#101;&#32;&#50;&#125;&#43;&#92;&#116;&#101;&#120;&#116;&#123;&#99;&#97;&#115;&#101;&#32;&#51;&#125;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></p>
<p style="text-align: center;"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-669d2648243918eccd15f80542493fb5_l3.png" class="ql-img-inline-formula" alt="&#65;&#91;&#117;&#93;&#61;&#109;&#97;&#120;&#92;&#123;&#119;&#40;&#117;&#44;&#118;&#41;&#43;&#92;&#115;&#117;&#109;&#95;&#123;&#120;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#125;&#117;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#119;&#104;&#101;&#110;&#32;&#125;&#120;&#32;&#92;&#110;&#101;&#113;&#32;&#118;&#125;&#32;&#65;&#91;&#120;&#93;&#43;&#92;&#115;&#117;&#109;&#95;&#123;&#119;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#125;&#118;&#125;&#65;&#91;&#119;&#93;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -8px;"/></p>
<p class="ql-center-picture"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-f70e50d3a1b861c8a7bfda08da516066_l3.png"class="ql-img-picture"alt="Rendered by QuickLaTeX.com" title="Rendered by QuickLaTeX.com"/></p>
<p>Sum up: answer is at <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-1f04ca5dd1802657e55d9d9d248dd294_l3.png" class="ql-img-inline-formula" alt="&#65;&#91;&#114;&#111;&#111;&#116;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>.<br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-368f49f7e2e6969dcf2a7a06804240e8_l3.png" class="ql-img-inline-formula" alt=" &#65;&#91;&#117;&#93;&#32;&#61;&#32;&#109;&#97;&#120;&#32;&#92;&#108;&#101;&#102;&#116;&#92;&#123; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#99;&#99;&#125; &#92;&#115;&#117;&#109;&#92;&#108;&#105;&#109;&#105;&#116;&#115;&#95;&#123;&#118;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#125;&#117;&#125;&#65;&#91;&#118;&#93;&#92;&#92; &#32;&#92;&#92; &#109;&#97;&#120;&#92;&#123;&#119;&#40;&#117;&#44;&#118;&#41;&#43;&#92;&#115;&#117;&#109;&#92;&#108;&#105;&#109;&#105;&#116;&#115;&#95;&#123;&#120;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#125;&#117;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#119;&#104;&#101;&#110;&#32;&#125;&#120;&#32;&#92;&#110;&#101;&#113;&#32;&#118;&#125;&#32;&#65;&#91;&#120;&#93;&#43;&#92;&#115;&#117;&#109;&#92;&#108;&#105;&#109;&#105;&#116;&#115;&#95;&#123;&#119;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#125;&#118;&#125;&#65;&#91;&#119;&#93;&#92;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#46; " title="Rendered by QuickLaTeX.com" style="vertical-align: -40px;"/></p>
<p><strong>Running time:</strong><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-c393d5e20b7b380b37e61adce7619cac_l3.png" class="ql-img-inline-formula" alt=" &#65;&#91;&#117;&#93;&#32;&#61;&#32;&#109;&#97;&#120;&#32;&#92;&#108;&#101;&#102;&#116;&#92;&#123; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#99;&#99;&#125; &#79;&#40;&#100;&#101;&#103;&#114;&#101;&#101;&#40;&#117;&#41;&#41;&#92;&#92; &#79;&#40;&#99;&#94;&#50;&#41; &#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#46; " title="Rendered by QuickLaTeX.com" style="vertical-align: -17px;"/><br />
where <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-4a89e5fca0cac25fab9a2077085d3461_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#100;&#101;&#103;&#114;&#101;&#101;&#40;&#117;&#41;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> means how many children a certain node has.<br />
Number of states: <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/><br />
each state take <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-4a89e5fca0cac25fab9a2077085d3461_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#100;&#101;&#103;&#114;&#101;&#101;&#40;&#117;&#41;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.<br />
so:<br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-03ec66edf4ac04c30aad40f457243dde_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#117;&#109;&#92;&#108;&#105;&#109;&#105;&#116;&#115;&#95;&#123;&#117;&#32;&#92;&#105;&#110;&#32;&#118;&#125;&#100;&#101;&#103;&#114;&#101;&#101;&#40;&#117;&#41;&#61;&#50;&#109;&#61;&#50;&#40;&#110;&#45;&#49;&#41;&#61;&#50;&#110;&#45;&#50;&#61;&#79;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -16px;"/></p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-max-weight-matching-in-tree-latexlatex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Algorithms and Complexity &#8211; DP Hitting set</title>
		<link>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-hitting-set-latexlatex/</link>
		<comments>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-hitting-set-latexlatex/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 00:45:42 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Algorithms]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=348</guid>
		<description><![CDATA[Given: that all contain elements from means subset of , Subset is a hitting set if it contains an element from all Size Solve: Running Time: {Bi-u &#124; i=1 to m} takes there are amout of in , so this runs in times Subset has elements, have elements, so Rerolling above gives overall running time ...]]></description>
			<content:encoded><![CDATA[<p><strong>Given:</strong><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-3bfd19b4223f59a847d28c035b66cf5d_l3.png" class="ql-img-inline-formula" alt="&#65;&#61;&#123;&#97;&#95;&#49;&#44;&#97;&#95;&#50;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#97;&#95;&#110;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-31fd06ac3c9321fc7f1140f7a77279f7_l3.png" class="ql-img-inline-formula" alt="&#66;&#95;&#49;&#44;&#32;&#66;&#95;&#50;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#32;&#66;&#95;&#109;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> that all contain elements from <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a4d74e2862aea6346956bf8226d7a5a3_l3.png" class="ql-img-inline-formula" alt="&#65;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> means subset of <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a4d74e2862aea6346956bf8226d7a5a3_l3.png" class="ql-img-inline-formula" alt="&#65;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-44d6a0a5bd5beef843104b79db703a07_l3.png" class="ql-img-inline-formula" alt="&#124;&#66;&#95;&#105;&#124;&#32;&#92;&#108;&#101;&#113;&#32;&#99;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/><br />
Subset <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9b8ebc9fae8b1da6e33b8c8bf8227d94_l3.png" class="ql-img-inline-formula" alt="&#72;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#65;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> is a hitting set if it contains an element from all <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-2871fefe5b2f78e2135da580c84a8f58_l3.png" class="ql-img-inline-formula" alt="&#66;&#95;&#105;&#39;&#115;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/><br />
Size <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-051c463aa6df0fcc330fb8ba460edd6a_l3.png" class="ql-img-inline-formula" alt="&#107;&#32;&#61;&#32;&#124;&#72;&#124;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></p>
<p><strong>Solve:</strong></p>
<pre class="brush: java; title: ; notranslate">
Branching-HS(A, (B1, …,Bm), k)
if k = o: 		//base case
	if Bi = original Bi for some i:
		return “no HS”
	else return empty set
else:
	choose some Bi
	for u ∈ Bi
		Brahching-HS(A-u, {Bi-u | i=1, …, m}, k-1)
	if all recursive
		return “no HS”, then return “no HS”
	else:
            choose some u where u ∈ Bi worked,
            add u to the result from that, call and return.
</pre>
<p>Running Time:</p>
<ul>
<li>{Bi-u | i=1 to m} takes <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-900ee0a8a54ced926adae3d2b744168b_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#109;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></li>
<li><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-41ef867bbb05357df7158daf8ba87f22_l3.png" class="ql-img-inline-formula" alt="&#84;&#40;&#110;&#44;&#32;&#109;&#44;&#32;&#107;&#41;&#32;&#61;&#32;&#99;&#32;&#92;&#116;&#105;&#109;&#101;&#115;&#32;&#84;&#40;&#110;&#45;&#49;&#44;&#32;&#109;&#44;&#32;&#107;&#45;&#49;&#41;&#32;&#43;&#32;&#79;&#40;&#99;&#109;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></li>
<ul>
<li>there are <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8687fd1f30cfe7af386fb3b37c4a364f_l3.png" class="ql-img-inline-formula" alt="&#99;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> amout of <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-91046eab2bae67b9fdaedbbf21d543ca_l3.png" class="ql-img-inline-formula" alt="&#66;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>, so this runs in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8687fd1f30cfe7af386fb3b37c4a364f_l3.png" class="ql-img-inline-formula" alt="&#99;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> times</li>
<li>Subset has <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8687fd1f30cfe7af386fb3b37c4a364f_l3.png" class="ql-img-inline-formula" alt="&#99;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> elements, <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a4d74e2862aea6346956bf8226d7a5a3_l3.png" class="ql-img-inline-formula" alt="&#65;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> have <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> elements, <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8561833543d7c3c3c6ab5e2a2ac029f5_l3.png" class="ql-img-inline-formula" alt="&#99;&#92;&#108;&#101;&#113;&#32;&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> so <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-56320f988f504d7383468111ddc8d4ef_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#99;&#109;&#41;&#61;&#79;&#40;&#110;&#109;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></li>
</ul>
</ul>
<p>Rerolling above gives overall running time <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-51e588d9be57544b9670767ef1e41526_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#99;&#94;&#107;&#110;&#109;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-hitting-set-latexlatex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Algorithms and Complexity &#8211; DP No.1</title>
		<link>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-no-1-latexlatex/</link>
		<comments>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-no-1-latexlatex/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 22:27:50 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Complexity]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=319</guid>
		<description><![CDATA[Given: Set of intervals, each having weight  Want: Maximum weight subset of compatible intervals Means: we have:   requests labelled  with each  request  specifying a start time  a finish time  a weight  Two intervals are compatible if they do not overlap The goal is to find a subset  that maximize the sum of the weights of ...]]></description>
			<content:encoded><![CDATA[<p><strong>Given: </strong><br />
Set of <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> intervals<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ee9d89f99e77d6f30ac3e8c841d54ad3_l3.png" class="ql-img-inline-formula" alt="&#91;&#115;&#95;&#105;&#44;&#102;&#95;&#105;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>, each having weight <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-85385537bf4fd5ce49d71dcee293491d_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></p>
<p><strong>Want:</strong></p>
<p>Maximum weight subset of compatible intervals</p>
<p><strong>Means:</strong></p>
<p>we have:</p>
<ul>
<li> <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ab225258cc2cb329010b063fa0039976_l3.png" class="ql-img-inline-formula" alt="&#110;&#32;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> requests labelled <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ca290190344dc8fd7b3deead678ab0c9_l3.png" class="ql-img-inline-formula" alt="&#49;&#44;&#50;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></li>
<li>with each <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5441005a3d6cc3e5b97ca9d78793d6ab_l3.png" class="ql-img-inline-formula" alt="&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> request  specifying
<ul>
<li>a start time <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-4541ff7efd955415bf66706240c6c1c7_l3.png" class="ql-img-inline-formula" alt="&#115;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></li>
<li>a finish time <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-c5089ee173b8da25d9191f00bd515197_l3.png" class="ql-img-inline-formula" alt="&#102;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></li>
<li>a weight <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-85385537bf4fd5ce49d71dcee293491d_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></li>
<li>Two intervals are compatible if they do not overlap</li>
<li>The goal is to find a subset <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8839c9753efbc3ce7a075bd39586a4aa_l3.png" class="ql-img-inline-formula" alt="&#83;&#92;&#123;&#49;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#110;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> that maximize the sum of the weights of selected intervals.</li>
</ul>
</li>
</ul>
<p><strong>Solve:</strong></p>
<p>Assume all requests are sorted in order of finish time: <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-193e471d7c1aa3a22b1def6cee049aee_l3.png" class="ql-img-inline-formula" alt="&#102;&#95;&#49;&#92;&#108;&#101;&#113;&#32;&#102;&#95;&#50;&#32;&#92;&#108;&#101;&#113;&#32;&#102;&#95;&#51;&#32;&#92;&#108;&#101;&#113;&#32;&#92;&#100;&#111;&#116;&#115;&#32;&#92;&#108;&#101;&#113;&#32;&#102;&#95;&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></p>
<ul>
<li>We say a request <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5441005a3d6cc3e5b97ca9d78793d6ab_l3.png" class="ql-img-inline-formula" alt="&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> comes before a request <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> if <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-3af7c5338a23aa542bddec6ede853de7_l3.png" class="ql-img-inline-formula" alt="&#105;&#60;&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></li>
<li>define <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-4bbeef799c9abd5381aef5fabd2ff31a_l3.png" class="ql-img-inline-formula" alt="&#112;&#40;&#106;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>, for an interval <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>, to be the largest index <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-3af7c5338a23aa542bddec6ede853de7_l3.png" class="ql-img-inline-formula" alt="&#105;&#60;&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> such that intervals <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5441005a3d6cc3e5b97ca9d78793d6ab_l3.png" class="ql-img-inline-formula" alt="&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> are disjoint</li>
<li>means <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5441005a3d6cc3e5b97ca9d78793d6ab_l3.png" class="ql-img-inline-formula" alt="&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is the leftmost interval that ends before <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> begins, we define <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-6c427c51442b54ed26f7c9cce80e9587_l3.png" class="ql-img-inline-formula" alt="&#112;&#40;&#106;&#41;&#61;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> if no request <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-3af7c5338a23aa542bddec6ede853de7_l3.png" class="ql-img-inline-formula" alt="&#105;&#60;&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> is disjoint from <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.</li>
</ul>
<p><strong>Prove:</strong><br />
Let <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> be an optimal solution, ignoring for now we have no idea what <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is.<br />
<strong>Claim:</strong><br />
Either interval <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> (the last one) belongs to <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, or it doesn’t.</p>
<ul>
<li><span style="color: #800080;">Claim 1:</span> <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> belongs to <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, then no interval indexed strictly between <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-f260c6e204caa41b3c1ee8aa38d8b9bc_l3.png" class="ql-img-inline-formula" alt="&#112;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> can belong to <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> must include an optimal solution to the problem consisting of requests <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-eae548aa83977b2d43c7c015cdfcc88a_l3.png" class="ql-img-inline-formula" alt="&#92;&#123;&#49;&#44;&#92;&#100;&#111;&#116;&#115;&#32;&#44;&#112;&#40;&#110;&#41;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>.</li>
<ul>
<li>Thus <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-121ca843c79237a94e1e8080dae25792_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;&#45;&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is optimal for sub-instance <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-eae548aa83977b2d43c7c015cdfcc88a_l3.png" class="ql-img-inline-formula" alt="&#92;&#123;&#49;&#44;&#92;&#100;&#111;&#116;&#115;&#32;&#44;&#112;&#40;&#110;&#41;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> of intervals that finish <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ae6e89ecc1b16507767d1a16c2f38783_l3.png" class="ql-img-inline-formula" alt="&#92;&#108;&#101;&#113;&#32;&#115;&#95;&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/></li>
</ul>
<li><span style="color: #800080;">Claim 2:</span> <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> does NOT belong to <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, then <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is equal to the optimal solution to the problem consisting of requests <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-98c61d7c69df94484c886494472cfbc2_l3.png" class="ql-img-inline-formula" alt="&#92;&#123;&#49;&#44;&#8230;&#44;&#110;&#45;&#49;&#92;&#125;&#46;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></li>
<ul>
<li>Thus <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ac43deb6cd80e8318b5c7ee66f849207_l3.png" class="ql-img-inline-formula" alt="&#79;&#80;&#84;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is optimal for sub-instance <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e44d72f2a23850c5421c78184c53cf09_l3.png" class="ql-img-inline-formula" alt="&#92;&#123;&#49;&#44;&#8230;&#44;&#110;&#45;&#49;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></li>
</ul>
</ul>
<p>Now computes:</p>
<pre class="brush: java; title: ; notranslate">
MWIS(n)
if n=0
  return 0 //optimum over empty set
else
  return max{ MWIS(n-1), MWIS(p(n))+w(n) }
</pre>
<p>Just like Fibonacci numbers, it runs in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-58d766450ce40e5a30d5719fce544065_l3.png" class="ql-img-inline-formula" alt="&#84;&#40;&#110;&#41;&#61;&#84;&#40;&#110;&#45;&#49;&#41;&#43;&#84;&#40;&#110;&#45;&#50;&#41;&#43;&#79;&#40;&#49;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/><br />
Reusing computation:</p>
<pre class="brush: java; title: ; notranslate">
MWIS(n)
T  //array 1,...,n
T[0]=0
 for i = 1,…,n
T[i]= max{T[i],T[p(i)]+w(i)}
 return T[n]
</pre>
<p>Algorithm runs in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-27abed52a33fcc2a83242093738fc1d6_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> time<br />
Took <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-56f8e169bf14c2757b08c75400b92604_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#32;&#108;&#111;&#103;&#32;&#110;&#32;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> to sort intervals and to compute <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-fbe6af6312105fb9fcc5a88ab9f48556_l3.png" class="ql-img-inline-formula" alt="&#112;&#40;&#105;&#41;&#39;&#115;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>.</p>
<p>How to find optimal solution:</p>
<pre class="brush: java; title: ; notranslate">
call MWIS(n) to compute array T
S   //empty set
i   //n
while i &gt; 0
  if T[i]=T[p(i)]+w(i)
    add i to S
    i←p(n)
  else
    i←i-1
</pre>
<p>Note: array T contains the value of the optimal solution on the full instance.<br />
Note: each state of DP takes <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-44174b07fd408404e185aecd626b16bf_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#49;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> time, the algorithm runs <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-50d9617b405d7775c422cfb78dbf4645_l3.png" class="ql-img-inline-formula" alt="&#110;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> iterations → <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-27abed52a33fcc2a83242093738fc1d6_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/></p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/algorithms-and-complexity-dp-no-1-latexlatex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wallpapers in the past</title>
		<link>http://cassiechen.com/2011/11/wallpapers-in-the-past/</link>
		<comments>http://cassiechen.com/2011/11/wallpapers-in-the-past/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 21:56:11 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=281</guid>
		<description><![CDATA[还是整理一下我这乱七八糟的各种的桌面图纸好了。。 毕竟当年也是花了不少时间画出来的。                 详情见内，大图几十张=.= 我以前可真是闲着蛋疼啊。。]]></description>
			<content:encoded><![CDATA[<p>还是整理一下我这乱七八糟的各种的桌面图纸好了。。<br />
毕竟当年也是花了不少时间画出来的。<br />
<img src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-08-QIAQIA-1680x1050-150x150.jpg" alt="WP1" />        <img src="http://cassiechen.com/wp-content/uploads/2011/11/wallpapercircle-150x150.jpg" alt="WP2" />        <img src="http://cassiechen.com/wp-content/uploads/2011/11/Random-Evilcell-1280x10241-150x150.jpg" alt="WP3" /><br />
详情见内，大图几十张=.= 我以前可真是闲着蛋疼啊。。<br />
<span id="more-281"></span><br />

<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2009-08-qiaqia-1680x1050/' title='Wallpaper-2009-08-QIAQIA-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-08-QIAQIA-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2009-08-QIAQIA-1680x1050" title="Wallpaper-2009-08-QIAQIA-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-july-2009-kals-1680x1050/' title='Wallpaper-July-2009-Kals-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-July-2009-Kals-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-July-2009-Kals-1680x1050" title="Wallpaper-July-2009-Kals-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/b/' title='b'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/b-150x150.jpg" class="attachment-thumbnail" alt="b" title="b" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-april-2009-strikex-1650x10802/' title='Wallpaper-April-2009-Strikex-1650x10802'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-April-2009-Strikex-1650x10802-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-April-2009-Strikex-1650x10802" title="Wallpaper-April-2009-Strikex-1650x10802" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2009-06-priest-1680x1050/' title='Wallpaper-2009-06-priest-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-06-priest-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2009-06-priest-1680x1050" title="Wallpaper-2009-06-priest-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2009-05-aura-1680x1050/' title='Wallpaper-2009-05-Aura-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-05-Aura-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2009-05-Aura-1680x1050" title="Wallpaper-2009-05-Aura-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2009-03-draktul-1650x1080/' title='Wallpaper-2009-03-Draktul-1650x1080'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-03-Draktul-1650x1080-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2009-03-Draktul-1650x1080" title="Wallpaper-2009-03-Draktul-1650x1080" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2009-02-pwee-cast-1680x1050/' title='Wallpaper-2009-02-Pwee.Cast-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-02-Pwee.Cast-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2009-02-Pwee.Cast-1680x1050" title="Wallpaper-2009-02-Pwee.Cast-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2009-01-qiqia-1680x1050/' title='Wallpaper-2009-01-Qiqia-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2009-01-Qiqia-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2009-01-Qiqia-1680x1050" title="Wallpaper-2009-01-Qiqia-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpaper-2008-12-memz-1680x1050/' title='Wallpaper-2008-12-Memz-1680x1050'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Wallpaper-2008-12-Memz-1680x1050-150x150.jpg" class="attachment-thumbnail" alt="Wallpaper-2008-12-Memz-1680x1050" title="Wallpaper-2008-12-Memz-1680x1050" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/s/' title='s'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/s-150x150.jpg" class="attachment-thumbnail" alt="s" title="s" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/h/' title='h'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/h-150x150.jpg" class="attachment-thumbnail" alt="h" title="h" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/fr/' title='fr'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/fr-150x150.jpg" class="attachment-thumbnail" alt="fr" title="fr" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/bd/' title='bd'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/bd-150x150.jpg" class="attachment-thumbnail" alt="bd" title="bd" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/ad/' title='ad'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/ad-150x150.jpg" class="attachment-thumbnail" alt="ad" title="ad" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/attachment/11/' title='11'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/11-150x150.jpg" class="attachment-thumbnail" alt="11" title="11" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/random-evilcell-1280x10241/' title='Random-Evilcell-1280x10241'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/Random-Evilcell-1280x10241-150x150.jpg" class="attachment-thumbnail" alt="Random-Evilcell-1280x10241" title="Random-Evilcell-1280x10241" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/pic-flare-recruiting-icc1/' title='PIC-Flare-Recruiting-ICC1'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/PIC-Flare-Recruiting-ICC1-150x150.jpg" class="attachment-thumbnail" alt="PIC-Flare-Recruiting-ICC1" title="PIC-Flare-Recruiting-ICC1" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/wallpapercircle/' title='wallpapercircle'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/wallpapercircle-150x150.jpg" class="attachment-thumbnail" alt="wallpapercircle" title="wallpapercircle" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/pryda-1/' title='pryda-1'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/pryda-1-150x150.jpg" class="attachment-thumbnail" alt="pryda-1" title="pryda-1" /></a>
<a href='http://cassiechen.com/2011/11/wallpapers-in-the-past/skeetnanna-1920-1080/' title='skeetnanna-1920-1080'><img width="150" height="150" src="http://cassiechen.com/wp-content/uploads/2011/11/skeetnanna-1920-1080-150x150.jpg" class="attachment-thumbnail" alt="skeetnanna-1920-1080" title="skeetnanna-1920-1080" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/wallpapers-in-the-past/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Algorithms and Complexity No.4</title>
		<link>http://cassiechen.com/2011/11/algorithms-and-complexity-no-4-latexlatex/</link>
		<comments>http://cassiechen.com/2011/11/algorithms-and-complexity-no-4-latexlatex/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 10:05:44 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Complexity]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=236</guid>
		<description><![CDATA[WIS problem: Given: Suppose we are to schedule print jobs on a printer. Each job has a weight (representing how important the job is) and a processing time (representing how long the job takes). A schedule is an ordering of the jobs. For a given schedule , let be the finishing time of job in ...]]></description>
			<content:encoded><![CDATA[<p><strong>WIS problem:</strong><br />
<strong>Given:</strong><br />
Suppose we are to schedule print jobs on a printer. Each job <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> has a weight <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-b1857d1014fd88d2bb07d69ee80eb540_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#106;&#62;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/> (representing how important the job is) and a processing time <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-149b3494aeb1abdfd1fe9cc71b7646e9_l3.png" class="ql-img-inline-formula" alt="&#116;&#95;&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/> (representing how long the job takes). A schedule is an ordering <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-cf234ae74d5101971f02530b7e89b7a0_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#61;&#92;&#108;&#97;&#110;&#103;&#108;&#101;&#32;&#106;&#95;&#49;&#44;&#106;&#95;&#50;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#106;&#95;&#110;&#32;&#92;&#114;&#97;&#110;&#103;&#108;&#101;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> of the jobs.</p>
<p>For a given schedule <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e625a1305b57e9a2dc581646fa53a10b_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>, let <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-935abfc6dc699bbeab0adb666b9a9f32_l3.png" class="ql-img-inline-formula" alt="&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> be the finishing time of job <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9fbc777dc5e8c9b81d74a1dc3507b33f_l3.png" class="ql-img-inline-formula" alt="&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> in the schedule.</p>
<p><strong>Want:</strong><br />
Design a greedy algorithm that computes a schedule with minimum weighted average finishing time that minimizing <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-17187031365fd20766067760d9d5bf3d_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -8px;"/>.</p>
<p><strong>Solve:</strong><br />
Our greedy algorithm can be sorting the jobs in increasing <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-fe45b2184c95a82ff93445de9c7de740_l3.png" class="ql-img-inline-formula" alt="&#116;&#95;&#106;&#47;&#119;&#95;&#106;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/> order.</p>
<p>Assume for simplicity that no 2 jobs have the same ratio. To prove that the schedule is OPT, we resort to the usual exchange argument.<br />
Suppose the OPT is <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-cf234ae74d5101971f02530b7e89b7a0_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#61;&#92;&#108;&#97;&#110;&#103;&#108;&#101;&#32;&#106;&#95;&#49;&#44;&#106;&#95;&#50;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#106;&#95;&#110;&#32;&#92;&#114;&#97;&#110;&#103;&#108;&#101;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> and there are 2 adjacent indices <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-d5fd87be4a6642e5db6c338f6772c5b7_l3.png" class="ql-img-inline-formula" alt="&#106;&#95;&#105;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-51fc08fdf9da121e8b1c02fbe71e3c1a_l3.png" class="ql-img-inline-formula" alt="&#106;&#95;&#123;&#105;&#43;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> such that:
<p style="text-align: center;">
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a86f2234858a89a552c3a1f0d2b3cebc_l3.png" class="ql-img-inline-formula" alt=" &#92;&#102;&#114;&#97;&#99;&#123;&#116;&#95;&#123;&#106;&#95;&#105;&#125;&#125;&#123;&#119;&#95;&#123;&#106;&#95;&#105;&#125;&#125;&#62;&#92;&#102;&#114;&#97;&#99;&#123;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#125;&#123;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#125; " title="Rendered by QuickLaTeX.com" style="vertical-align: -16px;"/></p>
<p>Now, consider:</p>
<p style="text-align: center;"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-ad0710d8be1d72cb239253556ebeca40_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#39;&#61;&#92;&#108;&#97;&#110;&#103;&#108;&#101;&#32;&#106;&#95;&#49;&#44;&#106;&#95;&#50;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#106;&#95;&#123;&#105;&#45;&#49;&#125;&#44;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#44;&#106;&#95;&#123;&#105;&#125;&#44;&#106;&#95;&#123;&#105;&#43;&#50;&#125;&#44;&#92;&#100;&#111;&#116;&#115;&#44;&#106;&#95;&#110;&#32;&#92;&#114;&#97;&#110;&#103;&#108;&#101;&#44;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/></p>
<p>where we swap the position of <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-6bab33e45e3377c6184c37afa88e8b24_l3.png" class="ql-img-inline-formula" alt="&#106;&#95;&#123;&#105;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-51fc08fdf9da121e8b1c02fbe71e3c1a_l3.png" class="ql-img-inline-formula" alt="&#106;&#95;&#123;&#105;&#43;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>, and leave other jobs in their places. We now need to prove the change decreases the cost of the schedule.<br />
Notice that the finishing time of jobs other than <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-6bab33e45e3377c6184c37afa88e8b24_l3.png" class="ql-img-inline-formula" alt="&#106;&#95;&#123;&#105;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-51fc08fdf9da121e8b1c02fbe71e3c1a_l3.png" class="ql-img-inline-formula" alt="&#106;&#95;&#123;&#105;&#43;&#49;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> is the same in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e625a1305b57e9a2dc581646fa53a10b_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e3ffc5116f9e741a78bf12fd13a0a464_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>. Thus:</p>
<p style="text-align: center;"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8f444e9582b08555112abf6dc82d85da_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#41;&#45;&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -8px;"/><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5f3de9eb918ed0cbc62e60fc4fa79e7e_l3.png" class="ql-img-inline-formula" alt="&#61;" title="Rendered by QuickLaTeX.com" style="vertical-align: 2px;"/><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-449bd1417bf26070d705add593add110_l3.png" class="ql-img-inline-formula" alt="&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#95;&#105;&#41;&#43;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#41;&#45;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#95;&#105;&#41;&#43;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></p>
<p>Let <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-1f2cbfd17f6ec278d5bf2f530a4dd43f_l3.png" class="ql-img-inline-formula" alt="&#88;&#61;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#95;&#123;&#105;&#45;&#49;&#125;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>. Then:</p>
<p style="text-align: center;"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-f0ca78bab0012b7e975e01089eb702f1_l3.png" class="ql-img-inline-formula" alt="&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#95;&#123;&#105;&#125;&#41;&#32;&#61;&#32;&#88;&#43;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#44;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-b97150e4c10d107298b94c1b299436ff_l3.png" class="ql-img-inline-formula" alt="&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#41;&#61;&#88;&#43;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#43;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-535cade4c911f0f0c6f116603b29f40b_l3.png" class="ql-img-inline-formula" alt="&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#41;&#61;&#88;&#43;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-bb0d743723b32c29262ecae8b4550a43_l3.png" class="ql-img-inline-formula" alt="&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#95;&#123;&#105;&#125;&#41;&#61;&#88;&#43;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#43;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/></p>
<p>Plug those values into expression from above for the difference in cost between <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e625a1305b57e9a2dc581646fa53a10b_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e3ffc5116f9e741a78bf12fd13a0a464_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>. After simplifying we get:</p>
<p style="text-align: center;"><img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a3f752b2578b7816601a349a937e8e08_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#41;&#45;&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#41;&#61;&#45;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#43;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#46;" title="Rendered by QuickLaTeX.com" style="vertical-align: -9px;"/></p>
<p>Noting that
<p style="text-align: center;">
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a86f2234858a89a552c3a1f0d2b3cebc_l3.png" class="ql-img-inline-formula" alt=" &#92;&#102;&#114;&#97;&#99;&#123;&#116;&#95;&#123;&#106;&#95;&#105;&#125;&#125;&#123;&#119;&#95;&#123;&#106;&#95;&#105;&#125;&#125;&#62;&#92;&#102;&#114;&#97;&#99;&#123;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#125;&#123;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#125; " title="Rendered by QuickLaTeX.com" style="vertical-align: -16px;"/></p>
<p>implies <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-3fb28e63177487d0743ac639cd5f3f67_l3.png" class="ql-img-inline-formula" alt="&#45;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#43;&#119;&#95;&#123;&#106;&#95;&#123;&#105;&#43;&#49;&#125;&#125;&#116;&#95;&#123;&#106;&#95;&#123;&#105;&#125;&#125;&#62;&#48;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/>. so we get:<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-c966ff7b26f04c75d33075f8a9285f03_l3.png" class="ql-img-inline-formula" alt="&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#44;&#106;&#41;&#62;&#92;&#115;&#117;&#109;&#95;&#106;&#32;&#119;&#95;&#106;&#70;&#40;&#92;&#115;&#105;&#103;&#109;&#97;&#32;&#39;&#44;&#106;&#41;&#46;" title="Rendered by QuickLaTeX.com" style="vertical-align: -8px;"/></p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/algorithms-and-complexity-no-4-latexlatex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Algorithms and Complexity No.3</title>
		<link>http://cassiechen.com/2011/11/algorithms-and-complexity-no-3/</link>
		<comments>http://cassiechen.com/2011/11/algorithms-and-complexity-no-3/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 03:01:58 +0000</pubDate>
		<dc:creator>qiaqia</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Complexity]]></category>

		<guid isPermaLink="false">http://cassiechen.com/?p=151</guid>
		<description><![CDATA[Critical edges: Given: be a connected undirected graph. We say an edge is critical if removing it disconnects the graph. Want: Given an algorithm for identifying all critical edges. Solve: Fun DFS on G to get a single tree T. 1. non-tree edges cannot be critical This is because the tree keeps the graph connected ...]]></description>
			<content:encoded><![CDATA[<h3>Critical edges:</h3>
<p><strong>Given: </strong><br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a26d771386c1981c6b85f8059907f483_l3.png" class="ql-img-inline-formula" alt="&#71;&#61;&#40;&#86;&#44;&#69;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> be a connected undirected graph. We say an edge <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-7e1a3cb9fac66335ff9bca1bb70a6dfa_l3.png" class="ql-img-inline-formula" alt="&#40;&#117;&#44;&#118;&#41;&#92;&#105;&#110;&#32;&#69;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> is <strong>critical</strong> if removing it disconnects the graph.</p>
<p><strong>Want:</strong><br />
Given an algorithm for identifying all critical edges.</p>
<p><strong>Solve:</strong><br />
Fun DFS on G to get a single tree T.</p>
<blockquote><p>1. non-tree edges cannot be critical</p></blockquote>
<p>This is because the tree keeps the graph connected even if all non-tree edges are removed. This reduced the search space for critical edges from <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-be5b944a49ce600a881cd144edcc7054_l3.png" class="ql-img-inline-formula" alt="&#109;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> to just <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-73bfef163f14825b95fea5ca813f5555_l3.png" class="ql-img-inline-formula" alt="&#110;&#45;&#49;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/>.</p>
<p>Let <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-c2079222f9287ad88aeafbb8a946e9c8_l3.png" class="ql-img-inline-formula" alt="&#68;&#95;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> be the set of descendants of <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> in T, consider <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> to be a descendant of itself, so <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8be65a75fad456cfb05459916080a1bf_l3.png" class="ql-img-inline-formula" alt="&#117;&#92;&#105;&#110;&#32;&#68;&#95;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/>. Using the discovery times of DFS define for every vertex <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>:<br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-46d24fefd820c2d9208e137a5c52c11a_l3.png" class="ql-img-inline-formula" alt=" &#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;&#32;&#61;&#32;&#109;&#105;&#110;&#32;&#92;&#108;&#101;&#102;&#116;&#92;&#123; &#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#114;&#114;&#97;&#121;&#125;&#123;&#99;&#99;&#125; &#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#119;&#93;&#32;&#38;&#32;&#124;&#32;&#40;&#120;&#44;&#119;&#41;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#105;&#115;&#32;&#97;&#32;&#110;&#111;&#110;&#45;&#116;&#114;&#101;&#101;&#32;&#101;&#100;&#103;&#101;&#32;&#97;&#110;&#100;&#32;&#125;&#120;&#92;&#105;&#110;&#32;&#68;&#95;&#117;&#92;&#92; &#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#117;&#93; &#92;&#101;&#110;&#100;&#123;&#97;&#114;&#114;&#97;&#121;&#125; &#92;&#114;&#105;&#103;&#104;&#116;&#46; " title="Rendered by QuickLaTeX.com" style="vertical-align: -17px;"/><br />
Recall DFS tree of an undirected graph, all non-tree edges connect 2 nodes such that one is the descendant of the other. So <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-67f6b5e7bace9dd4075e3f4a35e28754_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> captures how high up the tree we can go from u by taking zero or more edges down the tree followed by a single non-tree edge to reach a node <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-028e0beaa8320ad070f4f511280c6808_l3.png" class="ql-img-inline-formula" alt="&#119;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> up in the tree.</p>
<p>In order to keep <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-67f6b5e7bace9dd4075e3f4a35e28754_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> well defined (in case that no non-tree edge exists), we also consider the option of staying at <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>. The discovery time of the vertices decreases as we go up the tree we take the minimum of the discovery times of the vertices before mentioned.</p>
<p>We now claim that a tree edge <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5bdd5b28d9bcc1f13eed6140f38c67c4_l3.png" class="ql-img-inline-formula" alt="&#40;&#117;&#44;&#118;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/>, where <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-4ae0832a87d9eac6c60371b2199b4689_l3.png" class="ql-img-inline-formula" alt="&#118;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> is <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>&#8216;s parent, is a critical edge if and only if <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-9e2486b8198dbdb84f0e1ccb116757a4_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;&#61;&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>. The only way to remain connected is through a non-tree edge <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-8877929b3a9dc2930ead12c023526790_l3.png" class="ql-img-inline-formula" alt="&#40;&#120;&#44;&#119;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> where <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-c933c64e9bf2c4b78bb24f64994b7d2b_l3.png" class="ql-img-inline-formula" alt="&#120;&#92;&#105;&#110;&#32;&#68;&#95;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -3px;"/> and <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e949d9028342d66aeb07afab0c179160_l3.png" class="ql-img-inline-formula" alt="&#119;&#92;&#110;&#111;&#116;&#105;&#110;&#32;&#68;&#95;&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>.</p>
<p>In that case, we know that <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-98b1dd09a53c2c91714992e421b8cc8e_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#117;&#93;&#62;&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#119;&#93;&#92;&#103;&#101;&#113;&#32;&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>. Otherwise, if no such edge exists, we have <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a2722c2f524984ed273ea7ae82dd514b_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#117;&#93;&#61;&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> and removing <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-5bdd5b28d9bcc1f13eed6140f38c67c4_l3.png" class="ql-img-inline-formula" alt="&#40;&#117;&#44;&#118;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> disconnects the graph.</p>
<p>We could identify all critical vertices in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-27abed52a33fcc2a83242093738fc1d6_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> time if we had these low values.</p>
<p>To pre-compute<br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-0d0a57f54f5e54db8fd6731c878c49e1_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#101;&#97;&#114;&#108;&#105;&#101;&#115;&#116;&#45;&#110;&#111;&#110;&#45;&#116;&#114;&#101;&#101;&#125;&#91;&#117;&#93;&#61;&#109;&#105;&#110;&#92;&#123;&#92;&#116;&#101;&#120;&#116;&#123;&#100;&#125;&#91;&#119;&#93;&#124;&#40;&#117;&#44;&#119;&#41;&#92;&#116;&#101;&#120;&#116;&#123;&#32;&#105;&#115;&#32;&#97;&#32;&#110;&#111;&#110;&#45;&#116;&#114;&#101;&#101;&#32;&#101;&#100;&#103;&#101;&#125;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>,</p>
<p>for each vertex <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> in <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-900ee0a8a54ced926adae3d2b744168b_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#109;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> time. Then we can compute low by using the following relation:<br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-097297d6c2fd1cc4ad387db13c014649_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;&#61;&#92;&#109;&#105;&#110;&#95;&#123;&#120;&#92;&#105;&#110;&#32;&#68;&#95;&#117;&#125;&#92;&#116;&#101;&#120;&#116;&#123;&#101;&#97;&#114;&#108;&#105;&#101;&#115;&#116;&#45;&#110;&#111;&#110;&#45;&#116;&#114;&#101;&#101;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/>,<br />
which would take <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-27abed52a33fcc2a83242093738fc1d6_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> for each <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-71f36909c806a677cb13356ddf959cf6_l3.png" class="ql-img-inline-formula" alt="&#117;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/>.</p>
<p>Thus computing <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-67f6b5e7bace9dd4075e3f4a35e28754_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> for all <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-f4c993d4a7a772c0b6fc6a6e33876992_l3.png" class="ql-img-inline-formula" alt="&#117;&#32;&#92;&#105;&#110;&#32;&#86;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/> would take <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-b9cec7d40adfb2b25ec9d66a159c067b_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#94;&#50;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> time.</p>
<p>NOW, to get a more efficient algorithm we need to re-use come computation. This can be done if we re-difine <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-0f94952d7ed76dc67898ad60a564e87d_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: 0px;"/> recursively:<br />
<img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-a8a393832cb57d19ad8de25046edd5b7_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;&#61;&#92;&#109;&#105;&#110;&#95;&#123;&#120;&#92;&#105;&#110;&#32;&#68;&#95;&#117;&#125;&#92;&#116;&#101;&#120;&#116;&#123;&#101;&#97;&#114;&#108;&#105;&#101;&#115;&#116;&#45;&#110;&#111;&#110;&#45;&#116;&#114;&#101;&#101;&#125;&#91;&#117;&#93;&#44;&#32;&#92;&#109;&#105;&#110;&#95;&#123;&#118;&#58;&#99;&#104;&#105;&#108;&#100;&#32;&#111;&#102;&#32;&#117;&#125;&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;&#92;&#125;" title="Rendered by QuickLaTeX.com" style="vertical-align: -6px;"/>.</p>
<p>The two definitions are clearly equivalent, but the second one leads immediately to a <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-27abed52a33fcc2a83242093738fc1d6_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> algorithm for computing <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-67f6b5e7bace9dd4075e3f4a35e28754_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#108;&#111;&#119;&#125;&#91;&#117;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> for all <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-f4c993d4a7a772c0b6fc6a6e33876992_l3.png" class="ql-img-inline-formula" alt="&#117;&#32;&#92;&#105;&#110;&#32;&#86;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/>, provided <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-212de11cb90185a0767e3f65ccb3221d_l3.png" class="ql-img-inline-formula" alt="&#92;&#116;&#101;&#120;&#116;&#123;&#101;&#97;&#114;&#108;&#105;&#101;&#115;&#116;&#45;&#110;&#111;&#110;&#45;&#116;&#114;&#101;&#101;&#125;&#91;&#118;&#93;" title="Rendered by QuickLaTeX.com" style="vertical-align: -5px;"/> is given for all <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-e71513c53b95105105d59103b8259efe_l3.png" class="ql-img-inline-formula" alt="&#118;&#32;&#92;&#105;&#110;&#32;&#86;" title="Rendered by QuickLaTeX.com" style="vertical-align: -1px;"/>.</p>
<p>So this approach takes <img src="http://cassiechen.com/wp-content/ql-cache/quicklatex.com-f706242b43c7e231566ff21565b30e59_l3.png" class="ql-img-inline-formula" alt="&#79;&#40;&#109;&#43;&#110;&#41;" title="Rendered by QuickLaTeX.com" style="vertical-align: -4px;"/> time.</p>
]]></content:encoded>
			<wfw:commentRss>http://cassiechen.com/2011/11/algorithms-and-complexity-no-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

