Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, November 26, 2006

[TECH] Algorithm to find euler circuit in a graph in O(|E|)

Important observation I found is that, if we delete a cycle (delete all the edges which form a cycle) from the graph which has a Euler circuit, the property of the graph still remains, i.e the necessary and sufficient condition for the graph to have a Euler cycle is that every vertex should have even degree. And also there has to be a cycle at every vertex.

INPUT: G =(E,V)
v = v
euler_cycle = NULL;
while(|E| > 0){
 /*Find a cycle in G, start
   the search at v, returns c0 around 
  which cycle is formed*/
 c0 = FIND_CYCLE(G,v);
 v = GET_NON_ZERO_DEGREE_VERTEX(c0); 
/*Above can be done in constant time,
 using some space while finding the cycle
 */
 MERGE(c0,euler_cyle);
/*constant time operation,
 put c0 after an edge e1 in
 euler cycle which ends at 
 vertex 'v', we can just remember 
 the position of v n euler_cycle
 every time we merge*/

}

Thursday, November 23, 2006

[TECH] SPICE layout generator.......

I have been a bit of slackish this week, but sure I want to start running soon.

Last night I read about the BPlane (Binned Plane datastructure used in micromagic, I need to implement that in magic soon).

Tonight, I thought about backing up my CVS repository regularly into my external hardrive, so that I can keep all my projects safe.

SPICE Layout generator

My new project, which generates cell layout from by reading from the SPICE files (transistor netlist) directly. I need to rewrite some of the code for the algorithm which tries to find the EULER trace in the transistors graph (and also its p-stack dual graph). Its exiting for me start it today....

I'am in love with my life for the first time.......writing code is what I loved apart from all other tensions in life I love it

Tomorrow morning I'll be running for the sale in circuit city and best buy