Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 (Matchings; 10 marks) Your goal is to tile the floor of your living room using 2' x 1 tiles. Your house is old

image text in transcribed

Question 4 (Matchings; 10 marks) Your goal is to tile the floor of your living room using 2' x 1 tiles. Your house is old and quirky, so the shape of your living room is a pretty complicated polygon. There are also some free-standing interior walls that amount to having a hole in the area to be tiled. Thankfully, all is not lost: all the corners of the polygon and of the holes it may contain lie on a 1'x 1 grid and all walls follow edges of this grid. An example is shown in the following figure, where grid lines are dotted, fat lines represent living room walls, and the shaded area is the area to be tiled You want to decide whether you can tile your living room without having to break any tiles. A sample solution for the above figure is shown in the following figure Does this imply that the minimum-cost flow formulation actually solves the problem? In class, we will discuss that, if all edge capacities and node supplies/demands are integers, the minimum-cost flow algorithms discussed in class all to prove, each such solution find integral optimal solutions to the g corresponds to a solution of the airline scheduling problem iven minimum-cos t flow problem. As you are asked The following living room shape clearly cannot be tiled without breaking any tiles even though there are an even number of cells to be tiled: Since this is tedious to figure out by hand and you are a computer scientist, you prefer to develop an algorithm that solves this problem. The input to the algorithm is the side lengths w and h of the smallest rectangle that encloses your living room. This defines a grid with wx h cells and each cell at position (x, y) can be part of the area to be tiled or not. Thus, the second part of the input is the list of coordinates of all grid cells that are part of the area to be tiled. Develop an algorithm that, given this input, decides whether it is possible to tile your living room without breaking any tiles. If it answers yes, it should also output the placement of the tiles. Specifically, each tile covers two grid cells, so the placement of tiles can be represented by listing for each tile the two cells it covers. Argue that your algorithm is correct and analyze its running time. (Aim for an algorithm with running time O(n25), where n wh is the number of cells in the input.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions