tungwaiyip.info

home

about me

links

Blog

< March 2010 >
SuMoTuWeThFrSa
  1 2 3 4 5 6
7 8 910111213
14151617181920
21222324252627
28293031   

past articles »

Click for San Francisco, California Forecast

San Francisco, USA

 

Peak Traffic Solution (Facebook Programming Puzzle)

The Peak Traffic puzzle is easy to interpret. It is a graph problem to find all maximal cliques. Implementating it, like many graph problems, is quite difficult though. The possible combination is huge. And there is no simple ordering graph subset. It end up costed me several days to do it. Here is the outline of my solution:

  1. Parse the input. Generate an undirected graph.
  2. Generate a list of cliques using recursive algorithm.
  3. Eliminate subsets from the result to find all maximal cliques.

After working on it for several days, I'm quite done. I haven't spent any more effort to optimize it and expain it. So here is my un-tidied code.

2010.03.03 [] - comments

 

 

blog comments powered by Disqus

past articles »

 

BBC News

 

Amazon fires: G7 leaders close to agreeing plan to help, says Macron (26 Aug 2019)

 

Ariana Grande 'overwhelmed' on return to Manchester at Pride (26 Aug 2019)

 

Asian stocks drop as US-China trade war escalates (26 Aug 2019)

 

G7 summit: Iranian foreign minister attends unexpected talks (25 Aug 2019)

 

Women hit back at 'slut-shaming' (25 Aug 2019)

 

Mallorca aircraft collide in mid-air, killing at least seven (25 Aug 2019)

 

Hong Kong police fire gun and use water cannon on protesters (26 Aug 2019)

 

Floods kill more than 60 in Sudan (25 Aug 2019)

 

Brexit: Boris Johnson says odds of striking deal 'touch and go' (25 Aug 2019)

 

Israel says it struck Iranian 'killer drone' sites in Syria (25 Aug 2019)

more »

 

SF Gate

 

Banks want efficiency. Critics warn of backsliding (25 Aug 2019)

 

Our favorite back-to-school tech picks (25 Aug 2019)

 

Branded podcasts a surprise hit with consumers (25 Aug 2019)

 

Terrorists turn to bitcoin for funding, and they’re learning fast (23 Aug 2019)

 

DoorDash: Workers will get paid more, keep tips (23 Aug 2019)

 

Trump says he will raise existing tariffs on Chinese goods to 30% (23 Aug 2019)

more »


Site feed Updated: 2019-Aug-25 21:00