A Linear-Time Heuristic for Improving Network Partitions

Size: px
Start display at page:

Download "A Linear-Time Heuristic for Improving Network Partitions"

Transcription

1 A Linear-Time Heuristic for Improving Network Partitions ECE 556 Project Report Josh Brauer Introduction The Fiduccia-Matteyses min-cut heuristic provides an efficient solution to the problem of separating a network of vertices into 2 separate partitions in an effort to minimize the number of nets which contain nodes in each partition. The heuristic is designed to specifically handle large and complex networks which contain multi-terminal and also weighted cells. The worst case computation time of this heuristic increases linearly with the overall size of the network. Additionally, in practice in can be seen that the number of iterations that is typically required for the cutest to converge to the minimum value is typically very small. The key factor in obtaining this linear-time behavior is due to the fact that the algorithm moves one node at a time between partitions in an attempt to reduce the current cut-set by the maximum possible value. We must also note that at times, the maximum cut-set reduction will be negative; however, at this point we proceed with the algorithm as this allows the opportunity escape from a local minima, should we currently be in one. Upon the movement of a node, appropriate nodes connected to the moved cell are updated to represent the move. The use of simple, yet efficient data structures allows us the ability to avoid redundant searching for best cell to be moved, and similarly also prevents an excess and unnecessary updates to the neighbor cells that need to be updated. Thus the data structures themselves, assist in adding to the already efficient nature of the algorithm. The heuristic also contains a balance constraint which allows the user to retain control over the size of the created partitions. Algorithm The FM algorithm centers around 2 simple data structures which represent the network by relating both cells to nets and nets to cells. Example data structures are show below: Page 1 of 10

2 Before describing the FM heuristic in its entirety, we first shall discuss a few common, yet potentially unfamiliar terms followed the basic sub routines used by the FM heuristic Cut-Set Refers to the set of all the nets in the network which cross the boundary between the two defined partitions. In other words, the cut-set is equal to the set of nets, which are connected to at least one node in each of the two defined partitions. Gain Every cell posses its own gain value. The gain value refers to the number of nets by which the current cut-set would reduce if the specified node were to be moved from the partition it is currently in to the other partition. Base Cell The base cell is the cell which has been selected to be moved to the other partition. Free Cell All the remaining cells in the network which are marked as unlocked and also not being evaluated as the base cell. Critical Net A critical net is defined as any net which contains a cell, which if moved, will change its cut-state. From Block (F) The From Block of a base cell x is defined as the set of cells connected to x by a specified net n, which live in the partition that the base cell x would be moving from. To Block (T) The To Block of a base cell x is defined as the set of cells connected to x by a specified net n, which live in the partition that the base cell x would be moving to. We now can take a look a few specific sub functions that are used within the FM algorithm. These functions are presented separately from the algorithm itself in order to provide the reader with additional clarity when traversing the steps of the heuristic. Balance Constraint R* V - S max <= A <= R* V + S max Where: R = Balance factor between 0 and 1 (typically ~ 0.5) V = A + B = total size of both partitions S max = Weight of the largest cell in the network Page 2 of 10

3 This formula is the controlling factor in maintaining a balance set of partitions. From this we can a validity range for partition A which we can check against each time we wish to move a cell across partitions. Note that only cells that contain the maximum gain AND also do not violate the balance constraint can be chosen as the base cell. Initial Network Data Input /* net-list input routine */ FOR each net n = 1 N DO FOR each (cell, pin) pair (i,j) on net n DO /* maintain set property */ IF net n is not at the front of the net-list for cell i THEN Insert cell i into the cell-list of net n and insert net n into the net-list of cell i END FOR END FOR This pseudo code, as presented in the reference paper, fills the previously mentioned data structures with the initial set-up of our network. The code operates by simply utilizing nested for loops to traverse all the data in the input network, we then routinely insert the current net/cell data into our arrays. Initial Gain Calculation FOR each cell i in the network DO g(i) 0; F from blocks of cell i; T To blocks of cell i FOR each net n on cell i DO IF F(n) = 1 THEN g(i) = g(i) +1; IF T(n) = 0 THEN g(i) = g(i) 1; This sub routine simply processes each node in the network and analyses its From Block and its To Block as described previously. This code operates by simply traversing each node in the network and assigning it s From and To Blocks as described earlier. Then we iteratively check each net on our current cell if the From Block size = 1 then we are the only connected node in our partition, and thus the net must already cross the boundary, thus by moving to the other partition we will reduce the cut-set by one, thus we increment the current cells gain. Similarly, if there exists no nodes in the To Block, then we are only Page 3 of 10

4 connected to a cell in our current partition by this net. Thus by moving across the boundary we will add an extra net to the cutest, thus we reduce the gain by one. Updating Cell Gains This algorithm as stated in the Circuit Partition Lecture Notes displays the routine to following when updating the neighbor cells which are connected to the base cell via a critical net. The routine simply analyses the From and To Blocks on each net with respect to the base cell. Then for each net n on the base cell we check if there are no nodes in the To Block and if so we increment the gain on all of the other free cells on n because since we are moving the current cell to the other partition we would increment the cut-set, thus after that move if we to move one of the free cells, it would undo this addition to the cut-set thus incrementing its own gain. Else we check if T(n) = 1, we decrement the gain of the only T cell since after moving our current cell, if we were to move the T cell it would cause this net between itself and the current base cell to be added to the cut-set. We then update the From and To Blocks to reflect the move by decrementing F of the cell that it lost and incrementing T of the cell that it gained. We can now use the exact opposite reasoning as stated above to describe the procedure of the check the From Block after the base cell move has been completed. At this point we have covered enough background information, terms and routines to be able to accurately analyze the FM algorithm in its entirety. As we will see upon examining the full FM heuristic, the simple terms and routines described earlier make up the majority of the FM algorithm itself. The rest of the heuristic simply forms the process by which the other routines are used. Page 4 of 10

5 A pseudo code representation of the algorithm is as follows: 1. Gather input data and store into the relevant structures. 2. Compute gains of all cells 3. i = 1, Select base cell ci that has (i) max. gain, (ii) satisfies balance criterion. If tie, Then use size criterion or internal connections. If no base cell, then EXIT; 4. Lock c i ; update gains of cells of affected critical nets 5. If free cell is not-empty, Then i = i+1; select next base cell and go to step Select best sequence of moves c1, c2,, ck; (1 k i) such that G(k) = is maximum. If tie, then choose subset that achieves a superior performance. If G 0, Then EXIT 7. Make all i moves permanent; Free all cells; Goto step 1. The first step of the algorithm simply involves getting the input data and storing it into the array as mentioned earlier. The next step, we initialize the gains of all the cells on the network using the straightforward method above. In the third step, we choose a base cell from the current set of free cells. This base cell must have the maximum possible gain while also ensuring that the balance constraint remains in tact. If the balance constraint will not hold, we look for the cell with the next best gain which satisfies the balance constraint. If we cannot find a base cell within these conditions we exit the program and offer our current solution. In the fourth step, we have found our base cell, and we now must lock it in place, and proceed to update the gains of all the other free cells using the above mentioned technique. At step five we check the list of free cells and if more free cells still exist, we go back to step three and repeat this process until there are no free cells left, at which time we proceed to step six. As of step six we have completed a pass through the network and we have accumulated a sequence of gains that result from each of the moves we have evaluated. The goal here is to choose the best sub-sequence of moves (i.e. The highest partial sum of gains that can be obtained by selecting the first k moves.). If the maximum partial sum of the gains turns out to be less than or equal to zero, we exit the program and return our most recent solution as our final solution, otherwise we proceed to step seven. At step seven we are ready to begin the next iterative pass through our newly updated network. We proceed to make all i moves permanent. We then re-mark all cells as free cells, and finally we return to step one, in order to run the next pass on our new partition set. Page 5 of 10

6 Program Structure My implementation of the Fiduccia-Mattheyses Heuristic will be in C++ and will follow the same general algorithms that were presented above, along with very similar data structures. Input Data The program 2 specific input files which describe the network at hand. The first input file lists each of the individual nets and also which exact cells are connected to the appropriate net. This file will also provide the program with the total number of nodes and the total number nets in the system on the first two lines of the input file respectively. The second input file is simply a list of all the cell numbers and also specifies an integer value for the weight of the cell. The format of the input files is shown below: Input File 1 Format: Example: [number of cells] [number of nets] [1] [connected cell 1]..[connected cell x] ~ [N] [connected cell 1]..[connected cell y] Input File 2 Format: Example: [1] [node 1 weight] ~ [C] [node C weight] Page 6 of 10

7 Data Structures The main data structures of the application will be stored as arrays of structures. The 2 appropriate structures are as follows: struct net { int id; vector<node*>* nodes; } struct node { int id; int gain; bool locked; vector<net*>* nets; } These two simple structures handle the majority of information that is needed to efficiently process the FM algorithm. We note that there is a small amount of redundancy between each net containing a list of nodes and each node also containing a list of nets, however this data is crucial to the effective linear runtime of the algorithm, thus the small amount of data overhead can be disregarded. Process The execution of the program will for the most part follow exactly as the FM algorithm above is presented. A simple step-by-step flow is as follows: --Initial set up 1. Obtains input data from files 2. Sets up appropriate data structures 3. Fills the data structures with the relevant data 4. Creates 2 initial partitions which satisfy the balance constraint -- Begins F-M algorithm 5. Calculates and stores the initial gains of all the cells based on partitions. 6. Calls the getmax() function which returns the cell with the maximum gain that satisfies the balance constraint, else returns -1. On a return of -1 we exit the program, presenting our most recent solution. 7. Marks the returned cell as locked. Stores the temporary move and gain information. Page 7 of 10

8 8. Calls the updategains() function to process the neighbor nodes of the base cell. 9. Check to see if there are any remaining free cells, if so we call our getmax() function again and we repeat the process that was described above in step Since no remaining free cells we process the sequence of data that was stored in step 7 and find the maximum partial sum of the move gains. If we find that this partial sum is less that or equal to zero the program will exit and present the most recent solution. 11. Since we have a positive partial sum gain at this stage, we now make all the previously stored temporary moves permanent and mark all of the cells in the network as unlocked. 12. We the repeat the loop starting back at step 5. Results At the time of this writing my C++ implementation is not fully functional and thus not producing accurate results. The reasons for this will be discussed later on in the discussion session of this paper. In light of this, I will now present to you the author s results and give a brief analysis as I would expect my results to be somewhere in the general vicinity of the results except for the running time which I suspect would be somewhat higher based upon the faster speeds of present computer systems. Author s Results: Cells Nets Pins Passes Time Chip Chip Chip Chip The author states that the four sample chips above have an average of 267 cells, 245 nets, and 2650 pins. It is also worth noting that at the time this test was run, the algorithm was able to execute about 900 moves per cpu-second which of course by today s standards is incredibly slow. Thus by looking at how fast this algorithm performed back then as compared to how fast computers run these days, the actual run time of this algorithm is very small. It is also interesting to note the amazingly small number of passes that is actually required for the algorithm to converge to a final and effective solution. Page 8 of 10

9 Discussion As mentioned earlier in the report I have been unable up to implement the tool at full functionality at the time of this writing. This has been attributed mainly to the fact that this course has been my first significant development experience using the C/C++ language. Combined with the intense programming required, this proved to be a very difficult hill to climb. The majority of issues that I encountered were related to memory management of the more complex data structures. Due to the complexity of these structures I found it rather difficult to manually handle all of the data allocation for these objects as this is something I have never had to do before. Initially for this project, I had completed the program structure outline that is shown above before actually implementing any code. The data structures seemed to be relatively straight-forward, as did the overall FM algorithm so I did not foresee any significant errors arising. Upon implementation however, I had several issues dealing with large amounts of input data and setting up the data structures to hold the information. I spent extensive time attempting to do additional research to verify that my memory allocation techniques were correct and I did find some useful information. Unfortunately I got to a point in which the program would generate and invalid memory reference ( Segmentation Fault ) on a vast majority of the runs. The part that I was not able to understand is that the Fault error would not reproduce every time. At some points the program would execute all the way through, however, some of the information in the data structures seemed to corrupt. I spent a great deal of time attempting to pinpoint the exact location of this problem to no avail. At this point I decided to basically restart the implementation of the project using very basic structures and basic features and then once that is complete, I intended on adding in the full feature set of the F-M algorithm. In this second implementation I simply brought in a much simpler and more familiar data structure set from a previous implementation of the KL algorithm that I had worked. This set did not account for multi-terminal nets or weighted vertices; however I figured that once I had the base program working correctly, these additions would not be too difficult to add in. Up to this point I have had much more luck with this current implementation. I am able to successfully obtain all of the input data and access/modify it all as necessary. Upon the completion of the input data I began to work on the basic components of the FM algorithm, namely, generating an initial partition that satisfies the balance constraint, calculating the initial gains for each of the cells, and also developing the getmax() method that is described earlier in the paper. This method is able to supply the user with the cell that has the maximum gain and also will not violate the balance constraint that we have in place. Similarly it will tell you if there are no more possible base cells that can be chosen It was at this point that I simply ran out of time in the development process. I spent so much time attempting to debug my first implementation that I just did not have enough time to fully complete my second implementation even though everything up to this point seems to be working just fine using the simpler data structures. At this point if I were able to completely rework the project I believe I would continue on the same path that I am going right now. Things are making much more Page 9 of 10

10 sense now and additionally, as I stated above, the functionality up to this point in my second implementation is working well. References C. M. Fiduccia and R. M. Matteyses. A linear time heuristic for improving network partitions. In 19 th Design Automaton Conference, pages , 1982 Yu Hen Hu. University of Wisconsin - ECE 556 Course Lecture Notes, Circuit Partition Fiduccia Mattheyses Heuristics. Page 10 of 10

Partitioning. Course contents: Readings. Kernighang-Lin partitioning heuristic Fiduccia-Mattheyses heuristic. Chapter 7.5.

Partitioning. Course contents: Readings. Kernighang-Lin partitioning heuristic Fiduccia-Mattheyses heuristic. Chapter 7.5. Course contents: Partitioning Kernighang-Lin partitioning heuristic Fiduccia-Mattheyses heuristic Readings Chapter 7.5 Partitioning 1 Basic Definitions Cell: a logic block used to build larger circuits.

More information

Unit 5A: Circuit Partitioning

Unit 5A: Circuit Partitioning Course contents: Unit 5A: Circuit Partitioning Kernighang-Lin partitioning heuristic Fiduccia-Mattheyses heuristic Simulated annealing based partitioning algorithm Readings Chapter 7.5 Unit 5A 1 Course

More information

The Partitioning Problem

The Partitioning Problem The Partitioning Problem 1. Iterative Improvement The partitioning problem is the problem of breaking a circuit into two subcircuits. Like many problems in VLSI design automation, we will solve this problem

More information

VLSI Physical Design: From Graph Partitioning to Timing Closure

VLSI Physical Design: From Graph Partitioning to Timing Closure Chapter Netlist and System Partitioning Original Authors: Andrew B. Kahng, Jens, Igor L. Markov, Jin Hu Chapter Netlist and System Partitioning. Introduction. Terminology. Optimization Goals. Partitioning

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 18 All-Integer Dual Algorithm We continue the discussion on the all integer

More information

algorithms, i.e., they attempt to construct a solution piece by piece and are not able to offer a complete solution until the end. The FM algorithm, l

algorithms, i.e., they attempt to construct a solution piece by piece and are not able to offer a complete solution until the end. The FM algorithm, l The FMSAT Satisfiability Solver: Hypergraph Partitioning meets Boolean Satisfiability Arathi Ramani, Igor Markov framania, imarkovg@eecs.umich.edu February 6, 2002 Abstract This report is intended to present

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #29 Arrays in C

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #29 Arrays in C Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #29 Arrays in C (Refer Slide Time: 00:08) This session will learn about arrays in C. Now, what is the word array

More information

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. # 18 Transaction Processing and Database Manager In the previous

More information

Fundamentals of Operations Research. Prof. G. Srinivasan. Department of Management Studies. Indian Institute of Technology, Madras. Lecture No.

Fundamentals of Operations Research. Prof. G. Srinivasan. Department of Management Studies. Indian Institute of Technology, Madras. Lecture No. Fundamentals of Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture No. # 13 Transportation Problem, Methods for Initial Basic Feasible

More information

A Linear-Time Heuristic for Improving Network Partitions. C.M. Fiduccia and R.M. Mattheyses

A Linear-Time Heuristic for Improving Network Partitions. C.M. Fiduccia and R.M. Mattheyses A Linear-Time Heuristic for mproving Network Partitions C.M. Fiduccia and R.M. Mattheyses General Electric Research and Development Center Schenectady, NY 12301 An iterative mincut heuristic for partitioning

More information

Data Structures Lesson 9

Data Structures Lesson 9 Data Structures Lesson 9 BSc in Computer Science University of New York, Tirana Assoc. Prof. Marenglen Biba 1-1 Chapter 21 A Priority Queue: The Binary Heap Priority Queue The priority queue is a fundamental

More information

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi

Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 20 Priority Queues Today we are going to look at the priority

More information

Module 2: Classical Algorithm Design Techniques

Module 2: Classical Algorithm Design Techniques Module 2: Classical Algorithm Design Techniques Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu Module

More information

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Computer Programming Basic Control Flow - Loops Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Objectives To learn about the three types of loops: while for do To avoid infinite

More information

(Refer Slide Time: 00:50)

(Refer Slide Time: 00:50) Programming, Data Structures and Algorithms Prof. N.S. Narayanaswamy Department of Computer Science and Engineering Indian Institute of Technology Madras Module - 03 Lecture 30 Searching Unordered linear

More information

Practice Problems for the Final

Practice Problems for the Final ECE-250 Algorithms and Data Structures (Winter 2012) Practice Problems for the Final Disclaimer: Please do keep in mind that this problem set does not reflect the exact topics or the fractions of each

More information

Fast Bit Sort. A New In Place Sorting Technique. Nando Favaro February 2009

Fast Bit Sort. A New In Place Sorting Technique. Nando Favaro February 2009 Fast Bit Sort A New In Place Sorting Technique Nando Favaro February 2009 1. INTRODUCTION 1.1. A New Sorting Algorithm In Computer Science, the role of sorting data into an order list is a fundamental

More information

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Lecture - 8 Consistency and Redundancy in Project networks In today s lecture

More information

CS 216 Exam 1 Fall SOLUTION

CS 216 Exam 1 Fall SOLUTION CS 216 Exam 1 Fall 2004 - SOLUTION Name: Lab Section: Email Address: Student ID # This exam is closed note, closed book. You will have an hour and fifty minutes total to complete the exam. You may NOT

More information

Seminar on. A Coarse-Grain Parallel Formulation of Multilevel k-way Graph Partitioning Algorithm

Seminar on. A Coarse-Grain Parallel Formulation of Multilevel k-way Graph Partitioning Algorithm Seminar on A Coarse-Grain Parallel Formulation of Multilevel k-way Graph Partitioning Algorithm Mohammad Iftakher Uddin & Mohammad Mahfuzur Rahman Matrikel Nr: 9003357 Matrikel Nr : 9003358 Masters of

More information

(Refer Slide Time: 01:25)

(Refer Slide Time: 01:25) Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 32 Memory Hierarchy: Virtual Memory (contd.) We have discussed virtual

More information

(Refer Slide Time: 1:27)

(Refer Slide Time: 1:27) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 1 Introduction to Data Structures and Algorithms Welcome to data

More information

Lecture 4 Searching Arrays

Lecture 4 Searching Arrays Lecture 4 Searching Arrays 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning One of the fundamental and recurring problems in computer science is to find elements in collections,

More information

Lecture Notes on Linear Search

Lecture Notes on Linear Search Lecture Notes on Linear Search 15-122: Principles of Imperative Computation Frank Pfenning Lecture 5 January 28, 2014 1 Introduction One of the fundamental and recurring problems in computer science is

More information

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore

Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Compiler Design Prof. Y. N. Srikant Department of Computer Science and Automation Indian Institute of Science, Bangalore Module No. # 10 Lecture No. # 16 Machine-Independent Optimizations Welcome to the

More information

CAD Algorithms. Circuit Partitioning

CAD Algorithms. Circuit Partitioning CAD Algorithms Partitioning Mohammad Tehranipoor ECE Department 13 October 2008 1 Circuit Partitioning Partitioning: The process of decomposing a circuit/system into smaller subcircuits/subsystems, which

More information

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 13 Virtual memory and memory management unit In the last class, we had discussed

More information

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Module 02 Lecture - 45 Memoization

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Module 02 Lecture - 45 Memoization Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute Module 02 Lecture - 45 Memoization Let us continue our discussion of inductive definitions. (Refer Slide Time: 00:05)

More information

(Refer Slide Time 3:31)

(Refer Slide Time 3:31) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions

More information

Vertex Cover Approximations

Vertex Cover Approximations CS124 Lecture 20 Heuristics can be useful in practice, but sometimes we would like to have guarantees. Approximation algorithms give guarantees. It is worth keeping in mind that sometimes approximation

More information

Advanced Database Systems

Advanced Database Systems Lecture IV Query Processing Kyumars Sheykh Esmaili Basic Steps in Query Processing 2 Query Optimization Many equivalent execution plans Choosing the best one Based on Heuristics, Cost Will be discussed

More information

We have already seen the transportation problem and the assignment problem. Let us take the transportation problem, first.

We have already seen the transportation problem and the assignment problem. Let us take the transportation problem, first. Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 19 Network Models In this lecture, we will discuss network models. (Refer

More information

Elements of Dynamic Programming. COSC 3101A - Design and Analysis of Algorithms 8. Discovering Optimal Substructure. Optimal Substructure - Examples

Elements of Dynamic Programming. COSC 3101A - Design and Analysis of Algorithms 8. Discovering Optimal Substructure. Optimal Substructure - Examples Elements of Dynamic Programming COSC 3A - Design and Analysis of Algorithms 8 Elements of DP Memoization Longest Common Subsequence Greedy Algorithms Many of these slides are taken from Monica Nicolescu,

More information

Preclass Warmup. ESE535: Electronic Design Automation. Motivation (1) Today. Bisection Width. Motivation (2)

Preclass Warmup. ESE535: Electronic Design Automation. Motivation (1) Today. Bisection Width. Motivation (2) ESE535: Electronic Design Automation Preclass Warmup What cut size were you able to achieve? Day 4: January 28, 25 Partitioning (Intro, KLFM) 2 Partitioning why important Today Can be used as tool at many

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

Lecture 25 Spanning Trees

Lecture 25 Spanning Trees Lecture 25 Spanning Trees 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning, Iliano Cervesato The following is a simple example of a connected, undirected graph with 5 vertices (A,

More information

Discrete Optimization. Lecture Notes 2

Discrete Optimization. Lecture Notes 2 Discrete Optimization. Lecture Notes 2 Disjunctive Constraints Defining variables and formulating linear constraints can be straightforward or more sophisticated, depending on the problem structure. The

More information

TABLES AND HASHING. Chapter 13

TABLES AND HASHING. Chapter 13 Data Structures Dr Ahmed Rafat Abas Computer Science Dept, Faculty of Computer and Information, Zagazig University arabas@zu.edu.eg http://www.arsaliem.faculty.zu.edu.eg/ TABLES AND HASHING Chapter 13

More information

Example. CS 201 Selection Structures (2) and Repetition. Nested if Statements with More Than One Variable

Example. CS 201 Selection Structures (2) and Repetition. Nested if Statements with More Than One Variable CS 201 Selection Structures (2) and Repetition Debzani Deb Multiple-Alternative Decision Form of Nested if Nested if statements can become quite complex. If there are more than three alternatives and indentation

More information

Place and Route for FPGAs

Place and Route for FPGAs Place and Route for FPGAs 1 FPGA CAD Flow Circuit description (VHDL, schematic,...) Synthesize to logic blocks Place logic blocks in FPGA Physical design Route connections between logic blocks FPGA programming

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #17. Loops: Break Statement

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #17. Loops: Break Statement Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #17 Loops: Break Statement (Refer Slide Time: 00:07) In this session we will see one more feature that is present

More information

2 Homework: Bond class, fair value, duration & yield

2 Homework: Bond class, fair value, duration & yield Queens College, CUNY, Department of Computer Science Computational Finance CSCI 365 / 765 Spring 2018 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 2018 due Monday, Feb 12, 2018, 11.59 pm This will not

More information

Chapter 9. Software Testing

Chapter 9. Software Testing Chapter 9. Software Testing Table of Contents Objectives... 1 Introduction to software testing... 1 The testers... 2 The developers... 2 An independent testing team... 2 The customer... 2 Principles of

More information

(Preliminary Version 2 ) Jai-Hoon Kim Nitin H. Vaidya. Department of Computer Science. Texas A&M University. College Station, TX

(Preliminary Version 2 ) Jai-Hoon Kim Nitin H. Vaidya. Department of Computer Science. Texas A&M University. College Station, TX Towards an Adaptive Distributed Shared Memory (Preliminary Version ) Jai-Hoon Kim Nitin H. Vaidya Department of Computer Science Texas A&M University College Station, TX 77843-3 E-mail: fjhkim,vaidyag@cs.tamu.edu

More information

Lecture Transcript While and Do While Statements in C++

Lecture Transcript While and Do While Statements in C++ Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some

More information

CSC D70: Compiler Optimization Register Allocation

CSC D70: Compiler Optimization Register Allocation CSC D70: Compiler Optimization Register Allocation Prof. Gennady Pekhimenko University of Toronto Winter 2018 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip Gibbons

More information

MicroSurvey Users: How to Report a Bug

MicroSurvey Users: How to Report a Bug MicroSurvey Users: How to Report a Bug Step 1: Categorize the Issue If you encounter a problem, as a first step it is important to categorize the issue as either: A Product Knowledge or Training issue:

More information

Introduction to Programming in C Department of Computer Science and Engineering

Introduction to Programming in C Department of Computer Science and Engineering Introduction to Programming in C Department of Computer Science and Engineering Once we know structures and pointers to structures, we can introduce some very important data structure called link list.

More information

A Feasibility Study for Methods of Effective Memoization Optimization

A Feasibility Study for Methods of Effective Memoization Optimization A Feasibility Study for Methods of Effective Memoization Optimization Daniel Mock October 2018 Abstract Traditionally, memoization is a compiler optimization that is applied to regions of code with few

More information

Artificial Intelligence Prof. Deepak Khemani Department of Computer Science and Engineering Indian Institute of Technology, Madras

Artificial Intelligence Prof. Deepak Khemani Department of Computer Science and Engineering Indian Institute of Technology, Madras Artificial Intelligence Prof. Deepak Khemani Department of Computer Science and Engineering Indian Institute of Technology, Madras (Refer Slide Time: 00:17) Lecture No - 10 Hill Climbing So, we were looking

More information

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

BBM 201 DATA STRUCTURES

BBM 201 DATA STRUCTURES BBM 201 DATA STRUCTURES Lecture 8: Dynamically Allocated Linked Lists 2017-2018 Fall int x; x = 8; int A[4]; An array is stored as one contiguous block of memory. How can we add a fifth element to the

More information

(Refer Slide Time: 00:02:00)

(Refer Slide Time: 00:02:00) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 18 Polyfill - Scan Conversion of a Polygon Today we will discuss the concepts

More information

Parallel Computer Architecture and Programming Written Assignment 3

Parallel Computer Architecture and Programming Written Assignment 3 Parallel Computer Architecture and Programming Written Assignment 3 50 points total. Due Monday, July 17 at the start of class. Problem 1: Message Passing (6 pts) A. (3 pts) You and your friend liked the

More information

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS C H A P T E R 6 DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS OUTLINE 6- Binary Addition 6-2 Representing Signed Numbers 6-3 Addition in the 2 s- Complement System 6-4 Subtraction in the 2 s- Complement

More information

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Lecture notes on Transportation and Assignment Problem (BBE (H) QTM paper of Delhi University)

Lecture notes on Transportation and Assignment Problem (BBE (H) QTM paper of Delhi University) Transportation and Assignment Problems The transportation model is a special class of linear programs. It received this name because many of its applications involve determining how to optimally transport

More information

Measuring algorithm efficiency

Measuring algorithm efficiency CMPT 225 Measuring algorithm efficiency Timing Counting Cost functions Cases Best case Average case Worst case Searching Sorting O Notation O notation's mathematical basis O notation classes and notations

More information

Eu = {n1, n2} n1 n2. u n3. Iu = {n4} gain(u) = 2 1 = 1 V 1 V 2. Cutset

Eu = {n1, n2} n1 n2. u n3. Iu = {n4} gain(u) = 2 1 = 1 V 1 V 2. Cutset Shantanu Dutt 1 and Wenyong Deng 2 A Probability-Based Approach to VLSI Circuit Partitioning Department of Electrical Engineering 1 of Minnesota University Minneapolis, Minnesota 55455 LSI Logic Corporation

More information

Lecture Notes on Memory Layout

Lecture Notes on Memory Layout Lecture Notes on Memory Layout 15-122: Principles of Imperative Computation Frank Pfenning André Platzer Lecture 11 1 Introduction In order to understand how programs work, we can consider the functions,

More information

Heuristic (Informed) Search

Heuristic (Informed) Search Heuristic (Informed) Search (Where we try to choose smartly) R&N: Chap., Sect..1 3 1 Search Algorithm #2 SEARCH#2 1. INSERT(initial-node,Open-List) 2. Repeat: a. If empty(open-list) then return failure

More information

CSCI-1200 Data Structures Fall 2017 Lecture 13 Problem Solving Techniques

CSCI-1200 Data Structures Fall 2017 Lecture 13 Problem Solving Techniques CSCI-1200 Data Structures Fall 2017 Lecture 13 Problem Solving Techniques Review from Lecture 12 Rules for writing recursive functions: 1. Handle the base case(s). 2. Define the problem solution in terms

More information

Shared Memory Programming With OpenMP Computer Lab Exercises

Shared Memory Programming With OpenMP Computer Lab Exercises Shared Memory Programming With OpenMP Computer Lab Exercises Advanced Computational Science II John Burkardt Department of Scientific Computing Florida State University http://people.sc.fsu.edu/ jburkardt/presentations/fsu

More information

Lecture 7 Quicksort : Principles of Imperative Computation (Spring 2018) Frank Pfenning

Lecture 7 Quicksort : Principles of Imperative Computation (Spring 2018) Frank Pfenning Lecture 7 Quicksort 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In this lecture we consider two related algorithms for sorting that achieve a much better running time than

More information

Maximum Density Still Life

Maximum Density Still Life The Hebrew University of Jerusalem Computer Science department Maximum Density Still Life Project in course AI 67842 Mohammad Moamen Table of Contents Problem description:... 3 Description:... 3 Objective

More information

Red-Black trees are usually described as obeying the following rules :

Red-Black trees are usually described as obeying the following rules : Red-Black Trees As we have seen, the ideal Binary Search Tree has height approximately equal to log n, where n is the number of values stored in the tree. Such a BST guarantees that the maximum time for

More information

(Refer Slide Time: 01.26)

(Refer Slide Time: 01.26) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture # 22 Why Sorting? Today we are going to be looking at sorting.

More information

(Refer Slide Time 04:53)

(Refer Slide Time 04:53) Programming and Data Structure Dr.P.P.Chakraborty Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 26 Algorithm Design -1 Having made a preliminary study

More information

(Refer Slide Time: 00:01:30)

(Refer Slide Time: 00:01:30) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology, Madras Lecture - 32 Design using Programmable Logic Devices (Refer Slide Time: 00:01:30)

More information

Clean & Speed Up Windows with AWO

Clean & Speed Up Windows with AWO Clean & Speed Up Windows with AWO C 400 / 1 Manage Windows with this Powerful Collection of System Tools Every version of Windows comes with at least a few programs for managing different aspects of your

More information

Analysis of Algorithms. Unit 4 - Analysis of well known Algorithms

Analysis of Algorithms. Unit 4 - Analysis of well known Algorithms Analysis of Algorithms Unit 4 - Analysis of well known Algorithms 1 Analysis of well known Algorithms Brute Force Algorithms Greedy Algorithms Divide and Conquer Algorithms Decrease and Conquer Algorithms

More information

Important From Last Time

Important From Last Time Important From Last Time Volatile is tricky To write correct embedded C and C++, you have to understand what volatile does and does not do Ø What is the guarantee that it provides? Don t make the 8 mistakes

More information

You can also launch the instances on different machines by supplying IPv4 addresses and port numbers in the format :3410

You can also launch the instances on different machines by supplying IPv4 addresses and port numbers in the format :3410 CS 3410: Paxos Introduction In this assignment, you will implement a simple in-memory database that is replicated across multiple hosts using the Paxos distributed consensis protocol. You can download

More information

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Problem Solving through Programming In C Prof. Anupam Basu Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur Lecture 18 Switch Statement (Contd.) And Introduction to

More information

Subprime Fibonacci sequences

Subprime Fibonacci sequences CS 7A - Spring 2015 - Richard Guy s Sub-Fibonacci Sequence. Due 5/21/15 Subprime Fibonacci sequences 0.1 Background Theory Start like the Fibonacci sequence 0, 1, 1, 2, 3, 5,..., but before you write down

More information

Clustering Algorithms for general similarity measures

Clustering Algorithms for general similarity measures Types of general clustering methods Clustering Algorithms for general similarity measures general similarity measure: specified by object X object similarity matrix 1 constructive algorithms agglomerative

More information

Research Article Accounting for Recent Changes of Gain in Dealing with Ties in Iterative Methods for Circuit Partitioning

Research Article Accounting for Recent Changes of Gain in Dealing with Ties in Iterative Methods for Circuit Partitioning Discrete Dynamics in Nature and Society Volume 25, Article ID 625, 8 pages http://dxdoiorg/55/25/625 Research Article Accounting for Recent Changes of Gain in Dealing with Ties in Iterative Methods for

More information

Deep Learning for Visual Computing Prof. Debdoot Sheet Department of Electrical Engineering Indian Institute of Technology, Kharagpur

Deep Learning for Visual Computing Prof. Debdoot Sheet Department of Electrical Engineering Indian Institute of Technology, Kharagpur Deep Learning for Visual Computing Prof. Debdoot Sheet Department of Electrical Engineering Indian Institute of Technology, Kharagpur Lecture - 05 Classification with Perceptron Model So, welcome to today

More information

Replication for Logic Partitioning

Replication for Logic Partitioning for Logic Partitioning A Project Report Submitted to the Graduate School In Partial Fulfillment of the Requirements for the Degree Master of Science Field of Computer Science and Engineering By Morgan

More information

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators) Name: Email address: Quiz Section: CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will

More information

Lecture Notes on Arrays

Lecture Notes on Arrays Lecture Notes on Arrays 15-122: Principles of Imperative Computation July 2, 2013 1 Introduction So far we have seen how to process primitive data like integers in imperative programs. That is useful,

More information

Advanced FPGA Design Methodologies with Xilinx Vivado

Advanced FPGA Design Methodologies with Xilinx Vivado Advanced FPGA Design Methodologies with Xilinx Vivado Alexander Jäger Computer Architecture Group Heidelberg University, Germany Abstract With shrinking feature sizes in the ASIC manufacturing technology,

More information

Machine-Independent Optimizations

Machine-Independent Optimizations Chapter 9 Machine-Independent Optimizations High-level language constructs can introduce substantial run-time overhead if we naively translate each construct independently into machine code. This chapter

More information

Questions. 6. Suppose we were to define a hash code on strings s by:

Questions. 6. Suppose we were to define a hash code on strings s by: Questions 1. Suppose you are given a list of n elements. A brute force method to find duplicates could use two (nested) loops. The outer loop iterates over position i the list, and the inner loop iterates

More information

Parallel and Sequential Data Structures and Algorithms Lecture (Spring 2012) Lecture 16 Treaps; Augmented BSTs

Parallel and Sequential Data Structures and Algorithms Lecture (Spring 2012) Lecture 16 Treaps; Augmented BSTs Lecture 16 Treaps; Augmented BSTs Parallel and Sequential Data Structures and Algorithms, 15-210 (Spring 2012) Lectured by Margaret Reid-Miller 8 March 2012 Today: - More on Treaps - Ordered Sets and Tables

More information

A Framework for Space and Time Efficient Scheduling of Parallelism

A Framework for Space and Time Efficient Scheduling of Parallelism A Framework for Space and Time Efficient Scheduling of Parallelism Girija J. Narlikar Guy E. Blelloch December 996 CMU-CS-96-97 School of Computer Science Carnegie Mellon University Pittsburgh, PA 523

More information

Types of general clustering methods. Clustering Algorithms for general similarity measures. Similarity between clusters

Types of general clustering methods. Clustering Algorithms for general similarity measures. Similarity between clusters Types of general clustering methods Clustering Algorithms for general similarity measures agglomerative versus divisive algorithms agglomerative = bottom-up build up clusters from single objects divisive

More information

Genetic Algorithm for Circuit Partitioning

Genetic Algorithm for Circuit Partitioning Genetic Algorithm for Circuit Partitioning ZOLTAN BARUCH, OCTAVIAN CREŢ, KALMAN PUSZTAI Computer Science Department, Technical University of Cluj-Napoca, 26, Bariţiu St., 3400 Cluj-Napoca, Romania {Zoltan.Baruch,

More information

Multilevel Algorithms for Multi-Constraint Hypergraph Partitioning

Multilevel Algorithms for Multi-Constraint Hypergraph Partitioning Multilevel Algorithms for Multi-Constraint Hypergraph Partitioning George Karypis University of Minnesota, Department of Computer Science / Army HPC Research Center Minneapolis, MN 55455 Technical Report

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs

Graphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs Graphs and Network Flows IE411 Lecture 21 Dr. Ted Ralphs IE411 Lecture 21 1 Combinatorial Optimization and Network Flows In general, most combinatorial optimization and integer programming problems are

More information

CS2351 Data Structures. Lecture 7: A Brief Review of Pointers in C

CS2351 Data Structures. Lecture 7: A Brief Review of Pointers in C CS2351 Data Structures Lecture 7: A Brief Review of Pointers in C 1 About this lecture Pointer is a useful object that allows us to access different places in our memory We will review the basic use of

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 16 Cutting Plane Algorithm We shall continue the discussion on integer programming,

More information

Finding & Registering The Best Local Domain

Finding & Registering The Best Local Domain Finding & Registering The Best Local Domain FINDING AND REGISTERING THE BEST LOCAL DOMAIN I highly recommend that registering your key LOCAL Domain(s) and HOSTING should ALWAYS be done at the SAME PLACE.

More information

Unit Testing as Hypothesis Testing

Unit Testing as Hypothesis Testing Unit Testing as Hypothesis Testing Jonathan Clark September 19, 2012 You should test your code. Why? To find bugs. Even for seasoned programmers, bugs are an inevitable reality. Today, we ll take an unconventional

More information

Kalev Kask and Rina Dechter. Department of Information and Computer Science. University of California, Irvine, CA

Kalev Kask and Rina Dechter. Department of Information and Computer Science. University of California, Irvine, CA GSAT and Local Consistency 3 Kalev Kask and Rina Dechter Department of Information and Computer Science University of California, Irvine, CA 92717-3425 fkkask,dechterg@ics.uci.edu Abstract It has been

More information

Lecture 18 Restoring Invariants

Lecture 18 Restoring Invariants Lecture 18 Restoring Invariants 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In this lecture we will implement heaps and operations on them. The theme of this lecture is reasoning

More information

Segregating Data Within Databases for Performance Prepared by Bill Hulsizer

Segregating Data Within Databases for Performance Prepared by Bill Hulsizer Segregating Data Within Databases for Performance Prepared by Bill Hulsizer When designing databases, segregating data within tables is usually important and sometimes very important. The higher the volume

More information

CS102: Variables and Expressions

CS102: Variables and Expressions CS102: Variables and Expressions The topic of variables is one of the most important in C or any other high-level programming language. We will start with a simple example: int x; printf("the value of

More information

1 Black Box Test Data Generation Techniques

1 Black Box Test Data Generation Techniques 1 Black Box Test Data Generation Techniques 1.1 Equivalence Partitioning Introduction Equivalence partitioning is based on the premise that the inputs and outputs of a component can be partitioned into

More information