Free Essay

Csp Problem Set

In:

Submitted By CartoonModi
Words 1685
Pages 7
CSP Problem Set

6.1 How many solutions are there for the map-coloring problem in Figure 6.1? How many solutions if four colors are allowed? Two colors?

Answer:

we are looking at a map of Australia showing each of its states and territories, as in Figure 6.1, and that we are given the task of coloring each region either red, green, or blue in such a way that no neighboring regions have the same color.

To formulate this as a CSP, we define the variables to be the regions: WA, NT, Q, NSW, V , SA, and T.

The domain of each variable is the set {red; green; blue}.

The constraints require neighboring regions to have distinct colors; for example, the allowable combinations for WA and NT are the pairs {(red; green); (red; blue); (green; red); (green; blue); (blue; red); (blue; green)} . The constraint can also be represented more succinctly as the inequality WA NOT EQUAL TO NT, provided the constraint satisfaction algorithm has some way to evaluate such expressions. There are many possible solutions, such as {WA=red; NT =green; Q=red; NSW =green; V =red; SA=blue; T =red }.

6.2 Consider the problem of placing k knights on an n x n chessboard such that no two knights are attacking each other, where k is given and k≤n^2
a. Choose a CSP formulation. In your formulation, what are the variables?
b. What are the possible values of each variable?
c. What sets of variables are constrained, and how?
d. Now consider the problem of putting as many knights as possible on the board with-out any attacks.
e. Explain how to solve this with local search by defining appropriate ACTIONS and RESULT functions and a sensible objective function.
Answer:

(a) Solution A: There is a variable corresponding to each of the n2 positions on the board.
Solution B: There is a variable corresponding to each knight.

(b) Solution A: Each variable can take one of two values, {occupied, vacant}
Solution B: Each variable’s domain is the set of squares.

(c) Solution A: every pair of squares separated by a knight’s move is constrained, such that both cannot be occupied. Furthermore, the entire set of squares is constrained, such that the total number of occupied squares should be k.

Solution B: every pair of knights is constrained, such that no two knights can be on the same square or on squares separated by a knight’s move. Solution B may be preferable because there is no global constraint, although Solution A has the smaller state space when k is large.

(d) We will solve this using local search. Briefly describe in English a sensible successor function. Any solution must describe a complete-state formulation because we are using a local search algorithm. For simulated annealing, the successor function must completely connect the space; for random-restart, the goal state must be reachable by hill climbing from some initial state. Two basic classes of solutions are:
Solution A: ensure no attacks at any time. Actions are to remove any knight, add a knight in any un attacked square, or move a knight to any un attacked square.
Solution B: allow attacks but try to get rid of them. Actions are to remove any knight, add a knight in any square, or move a knight to any square.

(e) An objective function returns a number describing the desirability of the state. The key requirement is that the objective function must have its global optimum at the optimal solution (here, we are maximizing):
Solution A: the number of knights placed on the board. Since all states have no attacks, the global optimum of this function is in fact the optimal solution.
Solution B: Here we need to penalize for attacks. One might suggest maximizing #knights - #attacks, but one must be careful to avoid the possibility that the score can be improved by adding lots more knights at the cost of a few extra attacks. One can show that #knights - 2#attacks works

6.3 Consider the problem of construction (not solving) crossword puzzles: fitting words into a rectangular grid. The grid, which is given as part of the problem, specifies which squares are black and which are shaded. Assume that a list of words (i.e., a dictionary) is provided and that the task is to fill in the blank squares by using any subset of the list. Formulate this problem precisely in two ways:
a. As a general search problem. Choose an appropriate search algorithm and specify a heuristic function. Is it better to fill in the blanks one letter at a time or one word at a time?
b. As a constraint satisfaction problem. Should the variables be words or letters? Which formulation do you think will be better? Why?

Answer (a)
Problem formulation: Initial State: A grid of all empty squares, and a dictionary with all the words.

Goal: Every square (except the black ones) contains a letter, and every word slot (string of consecutive horizontal or vertical squares) contains a word from the dictionary. We might also want the constraint that no word is used more than once.

Successor function: There are many choices here. They break down roughly into word-at-a-time and letter at-a-time. We will go with word at a time: you can choose any word from the dictionary and place it in any word slot of the same length, as long as there are no contradictory letters already in place there. The resulting state has one more word slot lied in and (if we have the word-used-only-once constraint) one less word in the dictionary.
Path cost: No preference here, so each operator costs 1.

Search strategy: A constraint satisfaction algorithm is quite natural. The variables are the word slots, the domain of each variable is the list of words of appropriate length in the dictionary, and the constraints are that no word may be used twice, and that if two word slots intersect, they must have the same letter in the intersecting square. A* is also a reasonable approach for adding words to the puzzle.
Answer (b)
Heuristic: There are many choices here; the most-constrained-variable heuristic is an important one, but it is expensive to calculate exactly when the dictionary is large. That is, we don’t want to spend a lot of time going through 50,000 words to determine exactly how many t into each slot. We can get an estimate by choosing k words at random and seeing how many of them t into a slot. We can do the same with the

least-constraining-value heuristic: of the first k candidate words to all a slot, choose the one that imposes the least constraints on the intersecting slots. A* search requires a die rent sort of heuristic. If we know in advance where the black squares will be, then we can assign an estimated cost of 1 to every unlade word slot. This is admissible because a finished puzzle has no unlade word slots, and a puzzle with k unlade word slots requires at least k operations before achieving the goal state

6.4Give precise formulations for each of the following as constraint satisfaction problems:
a. Rectilinear floor-planning: find non-overlapping places in a large rectangle for a number of smaller rectangles.
b. Class scheduling: There is a fixed number of professors and classrooms, a list of classes to be offered, and a list of possible time slots for classes. Each professor has a set of classes that he or she can teach.
c. Hamiltonian tour: given a network of cities connected by roads, choose an order to visit all cities in a country without repeating any.

Answer (a)

To make this into a traditional constraint satisfaction problem, we will have to discretize the possible locations for the tiles. It’s clear that as we discretize more finely, we enable more possible solutions, but increase complexity. The most sensible solution is probably to have a variable for each small rectangle, which can take on, as values, possible locations of, say, its lower left corner within the big rectangle. It makes it relatively easy to check constraints, to see if any rectangles are overlapping. An alternative formulation is to have a variable for each location in the big rectangle, containing the value None or a value indicating one of the small rectangles overlaps that location. In this case, we automatically satisfy the non-overlapping constraint, but we’d have to work hard to be sure we had a coherent assignment (that is, the right number of contiguous locations were all assigned to the same small rectangle). One way to do it would be to assign a whole batch of them at once.

Answer (b) There are many choices here. Let’s say we have K classes, L profs, M possible times and N possible rooms.

Formulation 1: Have three different variables for each class: which professor, which time, and which room. So, we’d have K variables with domain size L, K with domain size M, and K with domain size N. Constraints would have to be that profs can’t be in two classes at the same time; that you can use the same room for two classes at the same time; that only appropriate professors are assigned to classes.

Formulation 2: Have two sets of variables, each of which have as their domain the K possible classes: L ×M variables representing professor time-slots and M× N variables representing room time slots. Constraints would have to be every class has to be assigned to exactly one room; that every class has to be assigned to exactly one prof; that only appropriate professors are assigned to classes. One rule of thumb is that it’s better to pick formulations in which variables have smaller domains, because the constraints can do more work for you in ruling out choices. Another rule of thumb is that its better to pick formulations that already have some of your constraints built in.

Similar Documents

Premium Essay

Metabical Paper

...Metabical Pre-Launch Opportunity There is an opportunity to address a few potential issues in the upcoming marketing campaign for CSPs’ newest weight loss drug Metabical. CSP needs to be certain that we are addressing the right opportunities leading up to our launch. As the Director of Marketing I have been asked to present a brief overview identifying issues with our current launch strategy. The following report represents the area that has been identified as the biggest opportunity that we are faced with moving forward. The context of this report is broken into separate categories’ that will each be addressed. Ultimately the goal of the report is make certain that we all are on the same page and agree that the issue at hand is the one we should attack. The most appropriate way to frame this problem/opportunity is structural (Schacter, 2014). Opportunity/Problem that is Import to CSP With any new product opportunity that our company brings to market there are always some key identified items that need to be addressed prior to that launch. The main problem we currently face is the pricing configuration of the product Metabical. We are seeking to exploit a multi-million dollar market with this new product. Statistics indicate that a significant number of Americans are overweight. For instance, by the year 2008, approximately 65% of the whole two hundred and thirty million adults in the country were obese (Quelch & Becham, 2010). It affects both the men and women. Research...

Words: 1396 - Pages: 6

Premium Essay

Contempory Organisational Design

...specialization, hierarchy of authority, centralization, professionalism and personnel ratios, to describe the internal characteristics of an organisation, and they create a basis for measuring and comparing organisation. Whereas contextual dimensions, they characterize the whole organisation, including its size, technology, environment and goals, and also describe the organisational setting that influences and shapes the structural dimensions. For some time, researchers have studied the relationship between a firm’s corporate financial performance (CFP) and its corporate social performance (CSP). Although many studies indicated that CSP is a determinant of CFP, other aspects of some research have been inconsistent. Some studies are criticized for using unrealizable CSP measures; others for missing control variables; and still others for assuming linearity without valid testing. CSP has been most frequently defined as “a business organisation’s configuration of principles of social responsibility, processes of social responsiveness, and policies, programs, and observable outcomes as they relate to the firm’s societal relationships” (Wood, 1991). Furthermore,...

Words: 3989 - Pages: 16

Free Essay

Model Checking Using Pat

...Master of Technology in Software Engineering by Anusha A Reg. No. 130928001 February 2014 Abstract The idea of Model Driven Development (MDD) is to specify requirements of systems in a formal (usually graphical) notation. UML is the initial and dominant modelling phase in software engineering arena. If errors are occurring in this phase of software development itself, it will cost a lot. Hence it is crucial to detect model level errors in the initial phase rather than later stages of software development. An approach to automatically verifying models composed of UML state machines. This approach helps in checking safety/liveness, properties, trace refinement, relationships and so on with the help of PAT (Process Analysis Toolkit) and CSP (communicating sequential programs). 1 1 1.1 Introduction State Machines The concepts behind state machines are about organizing the way a device, computer program, or other (often technical) process works such that an entity or each of its sub-entities is always in exactly one of a number of possible states and where there are well-defined conditional transitions between these states. The UML state diagrams are directed graphs in which nodes denote states and connectors denote state transitions. In UML, states are represented as rounded rectangles labeled with state names. The transitions, represented as arrows, are labeled with the triggering events followed optionally by the list of executed actions. 1.1.1 UML State Machine...

Words: 2632 - Pages: 11

Premium Essay

Nt1330 Unit 3 Assignment 1

...name and its countersign for security method. If it's glad then received the queries type the shopper and search the corresponding files within the info. Finally, notice that file and send to the shopper. If the server finds the entrant means that, it set the choice Path to those entrant. 5.2. System Module 5.2.1 User: Users, WHO have information to be hold on within the cloud and have confidence the cloud for information computation, contains each individual customers and organizations. 5.2.2 Cloud Service supplier (CSP): A CSP, WHO has vital resources and experience in building and managing distributed cloud storage servers, owns and operates live Cloud Computing systems. 5.2.3Third Party...

Words: 751 - Pages: 4

Premium Essay

Reflection

...high levels of decisions, in relation to becoming a qualified Community Specialist Practioner (CSP) after completing a SWOT analysis. Throughout this reflection I will be using the Gibbs (1998) model of reflection, the Gibbs cycle helps the reflective process. It is also structured, helps individuals to look at the situation and evaluate for future learning. Moon (2013). According to Adair (2013) decision-making and problem solving strategies will help individuals confidently make the right decisions within the role as a leader. In addition I will also discuss how I reflected, after completing my SWOT analysis to devise an action plan and goals, to reach my final target. A SWOT analysis is to identify an individual’s; Strengths, Weaknesses, Opportunities and Threats. A SWOT is a structured plan that helps identify strategies to help with positive and negative factors (internally and externally). It also helps to improve personal and professional development, identify areas to develop on and set goals. Pearce (2007). As part of my personal and professional development I needed to complete a SWOT analysis so that I could identify areas to develop, which would contribute to me becoming an effective CSP. I therefore felt to become an effective decision-maker within a team I needed to reflect on my weakness that could be holding me back slightly. During my first couple of weeks as a CSP within my practice placement, I decided to complete the SWOT analysis. Completing the tool I felt...

Words: 593 - Pages: 3

Premium Essay

Misery Loves Companies: Rethinking the Social Initiatives by Business

...Nien-he Hsieh, Linda Lim, Nitin Nohria, Lynn Paine, Gail Pesyna, Rob Phillips, Lance Sandelands, Debora Spar, Joe White, Richard Wolfe and the students in Jim Walsh’s “The Corporation in Society” Ph.D. seminar for their constructive comments on earlier versions of this paper. We also want to thank Marguerite Booker, John Galvin and Nichole Pelak for their helpful research assistance. The Harvard Business School, the University of Michigan Business School, and the Aspen Institute’s Initiative for Social Innovation through Business provided invaluable support for this project. Misery Loves Companies: Whither Social Initiatives by Business? Abstract Companies are increasingly being asked to provide innovative solutions to deep-seated problems of human misery. Organization and management scholarship can play an important role in understanding and guiding possible corporate responses. Theory and research to date have sought to reconcile possible corporate responses with economic premises about the purpose of the firm. Our goals in this paper are to reorient the debate and to spark new research about social initiatives by business. Acknowledging that firms already make such investments, we try to stimulate a fresh agenda for organizational scholarship in three ways. First, we depict the hold that economic reasoning has had on how organization theory conceives of the relationship between the firm and society. Second, we examine the consequences of this...

Words: 22352 - Pages: 90

Premium Essay

Organisational Behaviour

...Communication is the process by which information is transmitted and understood between two or more people. An effective transmission of information is very important to a business, as it involves all the persons and organisations connected with that business. Communication is a critical core skill for managers. In their standpoint, ‘effective’ communication is one means by which they get things done. For example putting forward a vision and informing workers in organisations. Being often referred to as lifeblood of an organisation, communication can bring great advantages, if operated as flawlessly as possible, or can completely devastate it, if being stagnated at some point in transmission. Therefore it is important for businesses to make sure there are no barriers to communications, so they serve to enhance firm’s competitiveness and build knowledge-sharing. The purpose of communication ranges from completing a task to satisfying human relationships within the organisation. Two types of communication networks can be used to achieve this; formal and informal. Formal communication networks define who should speak or report to whom. Such communication can be downward, upward and vertical. Downward is one-way, from superiors to those who report to them. This is when no reply is expected and is used only to give orders or provide information. Upward is a two-way communication referring to messages going from subordinates to superiors. This is when feedback is required from the...

Words: 3412 - Pages: 14

Free Essay

Csp Project

...Academic Year: 2013/14 Semester: 1 Tutorial Day/Time: 6pm Programme: FELS CSP Coordinator: Name of Agency/Project: Rural Electrification Program Agency Supervisor: Date Submitted: November 20, 2013 Acknowledgement I would like to thank the following persons; Mr. Daemon Carter, Mr. Pommels, Ms. Graham, Ms and Mr Anderson, members of the Rural Electrification Program who assisted me with the successful completion of my Community Service. Furthermore, I want to give gratitude to Mrs. Joan Lawla my CSP Tutor for making this possible for me to get exposure to doing Community Service and also the lord for giving me health and strength throughout this completion. Table of Content Pages Reflection 1..................................................................................................................................1 Reflection 2..................................................................................................................................3 Reflection 3..................................................................................................................................5 Reflection 4..................................................................................................................................6 Reference.....................................................................................................................................9 Appendices.......................

Words: 1607 - Pages: 7

Premium Essay

Managment

...A review on cloud computing security issues & challanges F. A. Alvi1, Ψ, B.S Choudary2 ,N. Jaferry3 , E.Pathan4 1 Department of Computer Systems Engineering, QUEST Nawabshah, Sindh, Pakistan 2 Department of Computer Systems Engineering, MUET Jamshoro, Sindh, Pakistan 3 Department of Computer Systems Engineering, QUEST Nawabshah, Sindh, Pakistan 4 Department of Electronic Engineering, QUEST Nawabshah, Sindh, Pakistan Abstract The new developments in the field of information technology offered the people enjoyment, comforts and convenience. Cloud computing is one of the latest developments in the IT industry also known as on-demand computing. It provides the full scalability, reliability, high performance and relatively low cost feasible solution as compared to dedicated infrastructures. It is the application provided in the form of service over the internet and system hardware in the data centers that gives these services. This technology has the capacity to admittance a common collection of resources on request. It is proving extremely striking to cash-strapped IT departments that are wanted to deliver better services under pressure. When this cloud is made available for the general customer on pay per use basis, then it is called public cloud. When customer develops their own applications and run their own internal infrastructure then is called private cloud. Integration and consolidation of public and private cloud is called hybrid cloud. But having many advantages for...

Words: 4903 - Pages: 20

Free Essay

Corporate Social Responsibility as an Organizational Attractiveness for Prospective Public Relations Practitioners

...2011 Greening, Turban / CORPORATE SOCIAL BUSINESS & SOCIETY / September 2000 PERFORMANCE Corporate Social Performance as a Competitive Advantage in Attracting a Quality Workforce DANIEL W. GREENING DANIEL B. TURBAN University of Missouri Several researchers have suggested that a talented, quality workforce will become a more important source of competitive advantage for firms in the future. Drawing on social identity theory and signaling theory, the authors hypothesize that firms can use their corporate social performance (CSP) activities to attract job applicants. Specifically, signaling theory suggests that a firm’s CSP sends signals to prospective job applicants about what it would be like to work for a firm. Social identity theory suggests that job applicants have higher self-images when working for socially responsive firms over their less responsive counterparts. The authors conducted an experiment in which they manipulated CSP and found that prospective job applicants are more likely to...

Words: 10981 - Pages: 44

Premium Essay

Aaliyah Case Summary

...The referring agency referral did not state how Aaliyah entered care. Aaliyah entered SAFY care from Palmetto County Behavioral Health. Per referring agency report, Aaliyah met the goals set for her and the facility has to offer. The referring agency did not report any behavioral problems; however, Aaliyah has a history of running away to meet adult men to have sex. PRS: Aaliyah has a history of displaying depression symptoms as deflated self-esteem, sadness and worthlessness. Aaliyah displays argumentative behaviors with peers and adults, resentful, blames others, deliberately ignores authority figures. Aaliyah lack coping skills to maintain healthy relationships, manage...

Words: 1407 - Pages: 6

Premium Essay

Industries and Csr

...Corporate Social Responsibility across Industries: When can who do well by doing good? Andreas G. F. Hoepnerab, Pei-Shan Yua* & John Fergusonc School of Management, University of St. Andrews, The Gateway, North Haugh, St. Andrews, KY16 9SS, UK Academic Fellow, Principles for Responsible Investment, PRI Secretariat, c/o UN Global Compact, DC2-612, United Nations, New York, NY 10017, US c Department of Accounting & Finance, University of Strathclyde, 100 Cathedral Street, Glasgow, G4 0LN, UK b a This version (3.0): March, 2010 First version (1.0): October, 2008 ___________________________________________________________________________ Abstract: While much of the previous literature considers whether corporate social responsibility (CSR) pays, we take a more nuanced perspective, theoretically and empirically, by investigating when CSR pays and for whom? Theoretically, we develop two contingency perspectives. First, we extend previous work to argue that CSR’s impacts on corporate financial performance (CFP) are moderated by five factors: CSR form, firm characteristics, time, national framework and industrial characteristics. Focusing on industrial characteristics, we theorise that differences in industries’ dependency on certain stakeholder groups, their proximity to the end consumer, their potential for social and environmental damages and their level of product / service differentiation moderate CSR’s value relevance. Our second contingency perspective considers for whom CSR might...

Words: 13014 - Pages: 53

Premium Essay

Corporate Social Responsibility and Financial Performance

...ijcrb.webs.com SEPTEMBER 2012 VOL 4, NO 5 INTERDISCIPLINARY JOURNAL OF CONTEMPORARY RESEARCH IN BUSINESS The Impact of Adopting Corporate Social Responsibility on Corporate Financial Performance: Evidence from Jordanian Banks Sulaiman R. Weshah Accounting Department, Amman College for finance and administration studies, Al Balqa applied university, Amman, Jordan Dr. Ahmad A. Dahiyat (Corresponding author) Accounting Department, Amman College for finance and administration studies, Al Balqa applied university, Amman, Jordan PO BOX 45, Postal code 11831 Mohammed R. Abu Awwad Islamic International Arab Bank, Amman, Jordan Emad S. Hajjat Accounting Department, Irbid College, Al Balqa applied university, Irbid, Jordan Abstract This study aims to present a suggested framework for Corporate Social Responsibility (hereafter CSR) and to examine if there is a relationship between (CSR), bank size, the level of risk in the bank and Advertising Intensity (hereafter ADINT) on one hand and the Corporate Financial performance (hereafter CFP) on the other hand in the Jordanian banking companies.As such, this study relied on the financial reports from banking companies listed in Jordanian Stock Exchange for the year 2011 and conducted literatures and empirical studies to obtain the results. statistical techniques are used to analyze data. Throughout this study, it is concluded that there is a significant positive relationship between (CSR), bank size, the level of risk in the bank...

Words: 5412 - Pages: 22

Premium Essay

Cloud Networking

...Description of cloud: A set of pooled computing resources, delivered over the web, powered by software. Cloud computing a form of computing that involves the interaction of several virtualized resources, meaning that many servers are connecting and sharing information that can expand and contract across servers depending on the amount of servers needed to manage the amount of traffic on various sites. Cloud computing is often provided “as a service” over the internet, typically in the form of infrastructure as a service (IaaS), platform as a service (PaaS), or software as a service (SaaS). Maturing virtualization in information technology systems has enabled increased implementations of the cloud computing paradigm, dissolving the need to co-locate user and computing power by providing desired services through the network. The “cloud” in “cloud computing” stems from the interconnectivity of the computers and computer networks that form the internet because, when these relationships are diagramed, the resulting image looks like a cloud. In its simplest terms, cloud computing is a new mode of computing where technology-enabled services are delivered to a set of consumers from a set of providers over the network. The definition is inclusive of compute, storage, network, application and service elements, typically running in large data centers accessed by a variety of mobile and fixed devices. Unlike prior computing systems that were essentially dedicated to individual businesses...

Words: 3185 - Pages: 13

Premium Essay

Operating System

...INTRODUCTION Cloud computing has boost a large amount of interest in the IT industry. The market research and analysis firm IDC suggests that the market for cloud computing services was $16bn in 2008 and will rise to $42bn/year by 2012 (Chhabra, Verma &ump; Taneja, 2010) .The era of cloud computing introduces a new dimension for Enterprises. The academia and research worlds have developed a keen interest into challenges and issues introduced by this relatively new concept (Sriram &ump; Khajeh-Hosseini, 2009). As experienced by large or small companies while adopting cloud computing technology, the issues can be outlined as security, privacy, data migration as (Hosseini, et al., 2010 ). Adoption of cloud technology by enterprises especially those are using KBE (knowledge based engineering) systems are in risk in terms of migration their data over the cloud. Most enterprises are in a midst of creating, sharing, streaming and storing data in digital formats to allow collaboration , hence there is a need to continuously managed and protect the data to ensure its value and authenticity (Yale &ump; Chow, 2011). Enterprises now acquire increasingly more information about their products, customers and partners- whether it’s stored in a cloud environment or not and failure to protect this data can be damaging. Partners and clients anticipate their information will be constantly protected before conducting business with a company. Within lay the need for complete data governance to...

Words: 2090 - Pages: 9