Free Essay

Graphing Applications and the Tsp

In: Other Topics

Submitted By jamesjamaz
Words 1227
Pages 5
Graphing Applications and the TSP



Graphing Applications and the TSP

Question 1

A Hamiltonian cycle is a closed loop within a graph that visits all its vertices exactly once. An example of the Hamiltonian cycle is the Travelling salesman problem. The solution to the minimum length of a Hamiltonian cycle is an NP complete problem that cannot be computed in polynomial time. This means that the minimum possible path cannot be computed by a deterministic machine. When completing a Hamiltonian cycle, one has to make sure that there are only two edges getting in and out of a vertex. In addition one has to ensure that there are no sub-cycles in the cycle. In a Hamiltonian cycle with n vertices, the number of different cycles that can be completed is (n-1)! /2 in a complete undirected graph and (n-1)! In a complete directed graph (Narasimhan, 2009).

Question 2

A Euler cycle is a path that passes through all the edges of a graph exactly once. It usually starts and ends at the same vertex. For one to construct a Euler cycle all the vertices in the graph must have an even degree. Therefore, one can conclude that any graph with all vertices of an even degree connected is a Euler cycle. Unlike the Hamiltonian cycle, the Euler cycle can be computed in polynomial time. The Euler cycle can be constructed using the Fleury’s or Hierholzer’s algorithm.

Question 3

The minimum length of a Hamiltonian cycle is the shortest path that can visit all the vertices of a graph exactly once. To evaluate it one needs to compare all possible routes through the cycle and find the one with least weight. The time complexity of finding the minimum length of a Hamiltonian cycle is exponential and cannot be accomplished in polynomial time. This time complexity makes it hard for one to evaluate it in a deterministic machine, thereby, making it a NP complete problem (Narasimhan, 2009).

Question 4

The determination of a Euler cycle is of polynomial time complexity. It can be evaluated in O(V+E) time where V is the number of vertices whereas E is the number of edges in the graph. A Euler cycle can be determined in polynomial time since it has only two vertices with an odd degree (the start and end vertices) (shown Fig.1). (Guckin, 1989).


Fig.1:Euler cycle

Fleury’s Euler cycle algorithm

• Ensure that the graph has 2 odd vertices or none.

• In case there are no odd vertices one can start anywhere. However, if there are them start at one of those points.

• All edges must be followed sequentially. Where one encounters a bridge and non-bridge the latter is the optimal choice.

• Stop when all edges are covered.

Pseudo code

#cycle is a global array Find_euler_cycle Cyclepos = 0 Find_cycle(vertex 1)

# visited and nextvertex is a local array
# the trail will be established in reverse find_cycle(vertex x) if vertex x does not have neighbours then cycle(cyclepos) = vertex x cyclepos = cyclepos + 1 else while (vertex x has neighbours) select a random neighbour vertex y of vertex x remove_edges(vertex y, vertex x) find_cycle(vertex y) cycle(cyclepos) = vertex x cyclepos = cyclepos+ 1.

The algorithms above run in O (V+E) time, thus, can be completed in polynomial time. However, larger graphs may result in the overflowing of the run time stack. The above algorithm can handle multiple edges and self loops in a graph.

Question 5

The TSP is a combinatorial optimization problem that cannot be solve in a deterministic computer. Actually, the problem cannot be solved in polynomial time. This is because as the number of cities increases the running time for the solution increases exponentially. In this regards, the TSP can be concluded to be a NP-complete problem. There are no existing polynomial time solutions that exist for any NP complete problem. However, there is no proof to show that such a problem cannot be solved in polynomial time (Narasimhan, 2009).

An NP problem can be solved by an indeterministic computer in polynomial time. The machine is able to make a choice of the right decision among a given set of choices. However, NP-complete problems cannot be solved in polynomial time but through exhaustive solutions. A problem is said to be NP-complete if it is in NP and if it is reducible in polynomial time. The TSP is a decision and optimisation problem. This makes it harder for the computer as it has to compute the decision and optimisation for the route with minimum weight (Ferreira & Pardalos,1996).


Fig. 2: Travelling Salesman problem

Fig.2 shows a simple TSP with 4 cities. The native solution for the optimal distance requires one to select a starting and ending point. Thereafter, one should calculate all the (n-1)! permutations for all the destinations. The cost of each permutation and the minimum cost permutation should be considered during the process. The last step will involve one returning the permutation with the lowest cost. The time complexity of this problem is O(n!).In a computer this problem can be solved through dynamic programming where one should develop recursive solutions in terms of sub-problems. Each set of a given size n the subsets considered will be n-2 each with the size n-1 such that they shall not have the nth term. From the recursive problems the solution will have O (n*2n) sub-problems that can be solved in linear time. The time complexity in this case is less than O(n!) but still has exponential space and time requirements.


Fig.3: TSP problem representation with cities a- e.

Fig.3 shows a TSP that seeks to find the optimal distance from city a to e. Fig.4 shows a tree solution to the sales man problem.However, there is a limitation in the number of levels the the solution will have. Additionally one should also note that some of the chains that will show the route of travel may generate duplicity at various level thereby limiting a solution. As the number of vertices in the problem increases, the tree becomes harder to compute and interprate. (Lawler,1985).


Fig.4: Solution tree for a TSP instance

Question 6

The TSP is a hard problem that would solve numerous challenges if an optimal solution were found. In this case a solution that could be completed in polynomial time. The fields of transport, delivery and routing would benefit greatly from this solution. One of its applications would be in postal delivery system, where the system would assign the postman with addresses for delivery, thereby, optimizing on delivery time.

If the TSP could evaluate the shortest routes in polynomial time, then it would save alot of time for postmasters and parcel delivery companies.


Ferreira, A., & Pardalos, P. M. (1996). Solving combinatorial optimization problems in parallel:

Methods and techniques. Berlin: Springer.

Guckin, A., Consortium for Mathematics and Its Applications (U.S.), & Faculty Advancement in

Mathematics Project. (1989). Euler circuits. Arlington, Mass.: COMAP

Lawler, E. L. (1985). The Traveling salesman problem: A guided tour of combinatorial optimization.

Chichester [West Sussex: Wiley.

Narasimhan, G. (2009). A note on the Hamiltonian circuit problem on directed path graphs. Madison,

Wis: University of Wisconsin-Madison, Computer Sciences Dept.…...

Similar Documents

Premium Essay


...Employment application form visa ASSISTANT & iNTERPRETER |1. Applicant Information | |Last Name |Rauf |First Name |Mustafayev |Other | | | | | | |names | | |Street Address |Azerbaijan, Sumgait city,mcrdis. 18, home 12, flat 4 | |Mobile Phone |055 2440090;050 3387288 |Home Phone |0186466211;0124156787 | |E-mail | | |Position Applied for |Temporary Visa Assistant and Interpreter | |2. Education | |University of College |Course / Degree |Qualifications and grades obtained ......

Words: 478 - Pages: 2

Premium Essay

Web Application

...past decade, but it is safe to say that there is a lot more work to be done. Here we choose to concentrate on Web Applications and we particularly approach them from the developer’s perspective. With every step taken towards better security on the internet, end-users are doing their bit to safeguard their systems and data. However, keeping in mind how commercial and competitive the world we live in has become and the manner in which the market for web related products has grown, it becomes imperative for a developer to ensure that his web application is not just marketable as a breakthrough user friendly concept but also as a secure one. We imagine a world where, every skilled developer is able to make phenomenal applications and is able to provide his users with a large amount of credibility and reliability in terms of security. We aim to conceptualize and subsequently generate a security tool exclusively for the developer, which will be able to scan his work for security lapses and loopholes thereby enhancing the product testing process and making it more wholesome and complete. Chapter – 2 PROBLEM DEFINITION Our project aims at designing an application that has the following features: 1. Identify a selected set of software security vulnerabilities like Cross Site Scripting, SQL injection, Command/Remote File injection in a web application 2. Generate a text report indicating an action (or a sequence of actions) that leads to......

Words: 6435 - Pages: 26

Free Essay

Tsp Manufacture

...fertilizers) and by itself. TSP (Triple Super Phosphate) represented as 0-46-0, is normally applied where plants are grown in soils with low or average levels of phosphorus. Its importance can be measured by the fact that in absence or it, the root development is weak, growth is stunted, productivity drops, the leaves or the edges of the leaves turn purple and in plants like tobacco and cotton, the leaves turn an abnormal color of dark green; potato tubers develop brown spots etc.   Because it is a fertilizer with slightly acidic composition, its effect is limited in neutral or alkali soils. Because the phosphorus in its composition dissolved easily in water, it shows its effects rapidly. TSP is used as a base fertilizer. If it’s applied too early, the phosphorus in it combines with the lime and other elements in the soil and loses its effectiveness. If it is applied after the planting or seeding, it remains on the surface and has little effect. For these reasons, it should be applied either during or immediately after planting, seeding for maximum effect. DAP (Diammonium Phosphate), MAP (Monoammonium Phosphate) and TSP (Triple superphosphate) are the most commonly traded phosphate fertilizers. TSP is made by reacting wet-process phosphoric acid with phosphate rock. Typically it contains 46% P2O5. TSP is produced in granular and non-granular form and is used both in fertilizer blends (with potassium and nitrogen fertilizers) and by itself.  TSP production amounts......

Words: 2164 - Pages: 9

Premium Essay


...Application Changing a Promotion System Read the Applications case study, changing a Promotion System, found on page 532-533 in your textbook. Answer the questions that fall after the case description; these are the three questions found in the lower half of page 533. Each question should be numbered, answered separately, and be at least 300 words in length but should be submitted as one file. 1. What is the likely cause of CSD’s problems? The likely cause of CSD’s problems is that they are not realizing the logic of prediction and that is not really a good way of viewing things and in this case the selection decision. Employee Tom and his performance in the Bioglass Company as a sale associate cannot and shouldn’t be viewed as a predictor of how he would be as a manager. The KSAOs required for success as a sales associate (e.g., sales techniques) are very different than the KSAOs needed to succeed as a manager (e.g., delegation, providing feedback, setting goals) (Heneman III, Judge, & Kammeyer-Mueller, 2012). 2. How might CSD, and Bioglass more generally, make better promotion decisions in the future? Be specific. CSD and Bioglass can make better decision promotion in the future by improving the overall selection process by incorporating some additional assessment methods into their hiring process. Those methods are specifically designed to assess the KSAOs needed for the offered job. Some appropriate methods for the managerial jobs include job...

Words: 621 - Pages: 3

Premium Essay


...Google Maps is an application that was released by Google for Android, which is an alternative to Apple's built-in maps application. Google Maps for mobile service can work with or without a GPS receiver. The "my location" feature uses the GPS / Assisted GPS location of the mobile device, if available, supplemented by determining the nearest wireless networks and cell sites. The software looks up the location of the cell site using a database of known wireless networks and sites. By triangulating the different signal strengths from different cell transmitters and then using their location property (retrieved from the online cell site database), My Location determines the user's current location. Wireless network location method is calculated by discovering the nearby WiFi hotspots and using their location property (retrieved from the online WiFi database, in the same way as the cell site database) to further discover the user's location. The software plots the streets in blue that are available with a yellow icon and a green circle around the estimated range of the cell site based on the transmitter's rated power. The estimate is refined using the strength of the cell phone signal to estimate how close to the cell site the mobile device is.  (2008-12-15)[update]Up until iOS 6, the built-in maps application on iOS was powered by Google Maps.[3] However, with the release of the first iOS 6 beta in June 2012, Apple announced that they had created their own map service.[4]......

Words: 860 - Pages: 4

Free Essay


...PAS300 02/14 Application for a Uruwhenua Aotearoa New Zealand Passport USE THIS FORM if you are 16 years or over and: Adult Renewal your name has not changed since your last passport was issued, AND your passport has not been lost or stolen. Use the Adult form if you are 16 years or over and: you are applying for a New Zealand Passport for the first time; or your name has changed since your last passport was issued; or your passport has been lost or stolen. Our New Zealand Passport Our passport is valued and respected around the world for its integrity. We ask you to provide a range of information so that we can maintain its integrity by confirming your identity and entitlement to a New Zealand Passport. The New Zealand Passport is valid for a maximum period of 5 years. The validity period starts from the date of issue and runs until the date of expiry. This icon is used when you need to take extra care. The instructions with this icon will help you to understand whether you need to complete a particular section, or remind you not to miss out important details. What you need to complete this application Two (2) identical recent colour photos of yourself Someone to act as an identity referee who is over 16 years of age and has a valid New Zealand Passport The correct application fee How to contact us New Zealand: Freephone 0800 22 50 50 Phone +64 4 463 9360 Fax +64 4 382 3410 Australia: Freephone 1300 559 535 Phone +61 2 9225 2300 Fax +61 2 9223 0223......

Words: 4566 - Pages: 19

Premium Essay


...|Monument Security, Inc. | |Employment Application | |An Equal Opportunity Employer | Please Print __/__/__ ___________________ ___________________ __ Date Last Name First Name Middle Present Address ______________________________ _______________ ___ _____-____ No. & Street City State Zip Permanent Address if different from present address ______________________________ _______________ ___ _____-____ No. & Street City State Zip (___) ________ (___) ________ ___-__-____ Cell Phone Home Phone Social Security Number Email Address: ______________________________ Employment Desired Position applying for: ______________________________________________ Are you applying for: Regular full-time work? Yes No Regular part-time work? Yes No What days and hours are you available for work? ______________________________________________ Are you available for work on weekends? Yes No Would you be available to work overtime, if necessary? Yes No If hired, on what date can you start work? __/__/__ Salary desired: ______________________________________________ Have you ever......

Words: 1476 - Pages: 6

Free Essay

Application Layer

...process the task only. Every layer does only specific work. I have chooses application layer from the OSI model because the world experiences the Internet through the use of the World Wide Web, e-mail, and file-sharing programs. These applications, as well as others, provide the human interface to the underlying network, allowing you to send and receive information with relative ease. Most of the applications are intuitive; they can be accessed and used without the need to know how they work. As we continue to study the world of networking, it becomes more important to know how an application is able to format, transmit, and interpret messages that are sent and received across the network. INTRODUCTION Application layer is the highest most layers in OSI and TCP/IP layered model and this layer exists in both layered Models because of its significance which is interacting with user and user applications. This layer is for applications which are involved in communication system. A user may or may not directly interacts with these applications. Application layer is where the actual communication is initiated and reflects. Because this layer is on the top of the layer stack it does not serve any other layers. Application layer takes the help of Transport and all layers below it to communicate or transfer its data to the remote host.When an application layer protocol wants to communicate with its peer application layer protocol on remote hosts it hands over the data or information......

Words: 1147 - Pages: 5

Free Essay


...Introduction I hope that what you are about to read will not only show the kind of person I am, but why I would make an excellent addition to the Arkham Staff! Below I will break down my application into various topics that I feel that should be addressed. Why I Think I Qualify For Staff There are a number of reasons why I believe I would qualify for a shot at a position as Staff on Arkham. The first reason being friendly and helpful throughout the community. I may not be extremely well known throughout Arkham (my constant name changing doesn't help that either), but I do my best to help those that are in need of help. I try to stop flame wars that may arise in chat and I am always on the lookout for trouble makers. The second reason why I think I qualify for Staff is prior experience. I have held several different Staff positions ranging from Helper all the way up to Administrator. Arkham has high expectations for their Staff and I am willing to push myself above and beyond these expectations. I have studied and completely understand which punishment should be given out when an issue arises. The third reason is that I am very well experienced with commands, what they do, and when to use them or not. Abuse of any command in any way, shape, or form is completely unacceptable in my own eyes. I personally do not like it when anything is abused, such as exploits, but when commands are being abused, that is an entire different ball game. The final reason why I......

Words: 410 - Pages: 2

Premium Essay


...Applications of the Scientific Method: Everyday Life Selina Mathieu Strayer University Professor Olivia Uitto SCI 110 August 9, 2015 The scientific method is a process for experimentation used to explore observations and answer questions. It is used unconsciously by many on a daily basis and understanding how to apply the method can be valuable in making decisions and solving problems. For this assignment, I have chosen to use the scientific method to demonstrate how to organize my cluttered apartment to fit two storage units thus eliminating two bills and lowering my debt. First I will ask a question or make an observation such as how will I fit two storage units into my small apartment or observe if there is enough space for them both. I could also break down the observations a bit more by laying out sizes of the units compared to my apartment and see if it is possible to fit everything inside while still able to live comfortably or get rid of some items. My first observation is that one of my storage units is small and would not take up a lot of room. I also have a lot of extra items in my unit that I could donate to family or thrift shops for a good tax write off down the road. I have also noticed that getting rid of the smaller unit will be quick thus leaving me with more time to figure out how to empty the bigger unit. The bigger unit will take more time to empty and may be needed for a couple more months. ...

Words: 1079 - Pages: 5

Premium Essay


...HRM410: Strategic Staffing Application Form Assignment YOUR NAME: You are the new HR manager for this fictitious (private sector) company, which has hundreds of employees and is clearly obligated under Title VII and other major employment regulations. Rather than starting over from scratch with a brand new application form, many HR managers would likely take a look at the existing form first. Using the table located at the very bottom of this document, identify the ten (10) items that are legally problematic* on this employment application form, why they are problematic, and what could possibly be in their place, if applicable. Use of the table is required. When you are done “save” or “save as” this document with your last name, then first initial and assignment name (e.g. SmithLApplForm.docx) and place your name in the table box above. Then load it to your Dropbox by end of Week 6. Please email your instructor if you have any questions. *By problematic we are looking for possible violations of various employment regulations. Note that some may not be blatantly illegal, but, rather problematic and best to avoid as a best practice. One final tip: Do not focus on stylist elements such as the layout of the application form or questions you do not “like.” Focus only on the legally problematic items. Today’s Date APPLICATION FOR EMPLOYMENT ABC Payroll Company An Equal Opportunity Employer Position applying for: Desired Rate of Pay $ ...

Words: 1864 - Pages: 8

Free Essay


...Graduate Job Seeker, P.O. Box 10678- 0100 Nairobi, 1st September, 2014. The Human Resource Manager, ABC Company, Box 34567– 00100, Nairobi. Dear Sir/ Madam RE: APPLICATION FOR GRADUATE TRAINEE ACCOUNTANT POSITION I am writing to express my interest in the position of accountant graduate trainee as advertised in STU newspaper. I recently graduated with a Bachelor of Commerce – Accounting and Finance from Kenyatta University and have a CPA 4 qualification. I am particularly attracted to your firm because your graduate training programme will help me gain hands on experience in the banking industry. During my time as a student I have had part-time jobs and an internship, all of which have given me a chance to work as part of a team and meet deadlines. Working at FGH company gave me a chance to inspire and motivate others while at the same time invest in my integrity and accountability skills. In addition to my formal education, I grasp fresh concepts quickly and can easily adapt to new changes. My first-rate communication skills will assist me in building a professional network of clients and colleagues. I have also learnt to give positive feedback, and to use it to set my own personal goals for self-improvement I welcome the challenge of working with you in a bid to build on my professional skills while upholding your dedication to exceptional customer service delivery. I would appreciate an opportunity to discuss my interest further with you. You can reach me at......

Words: 265 - Pages: 2

Free Essay


...APPLICATION FOR EMPLOYMENT Green Valley Hospital is an equal employment opportunity employer and does not discriminate against otherwise qualified applicants on the basis of race, color, creed, religion, ancestry, age, sex, sexual orientation, marital status, national origin, disability or handicap, or veteran status. THIS IS A VERY IMPORTANT DOCUMENT YOU MUST ANSWER EACH QUESTION FULLY AND ACCURATELY. FAILURE TO DO SO MAY RESULT IN YOUR APPLICATION NOT BEING CONSIDERED. IF INFORMATION IS LATER FOUND TO BE OMITTED OR INACCURATE ON YOUR APPLICATION AND IT IS DISCOVERED AFTER YOUR EMPLOYMENT HAS BEGUN, YOU MAY BE TERMINATED FROM EMPLOYMENT. ________________________________ DATE _________________________________________________________________ FULL PRINTED NAME OF APPLICANT PLEASE PRINT PERSONAL INFORMATION NAME________________________________________________________ LAST FIRST SOCIAL SECURITY NUMBER______________ MIDDLE LIST ALL OTHER NAMES BY WHICH YOU HAVE EVER WORKED OR BEEN EDUCATED: __________________________________________________________________________________________ (NOTE: THIS INFORMATION IS ONLY NECESSARY FOR VERIFICATION OF YOUR PRIOR WORK HISTORY AND EDUCATION) PRESENT ADDRESS ____________________________________________________________________________________________ STREET/APT NO. CITY STATE ____________________ ____________________ ______________________ HOME PHONE NUMBER CELL PHONE......

Words: 1355 - Pages: 6

Free Essay


...Application 11.6 1. If I were Andrea and concluded that there was little enthusiasm for my return to corporate headquarters, I would choose to stay at this company for a period of time. If the company still ignore my return and fail to take advantage of my word experience abroad, I will quit and change other job, because I cannot see the prospects and potential development in the future for this company. Global business experience and market resource have become the most valuable fortunes for me after three-year overseas assignment, which can attract more competitors in the same industry to hire me. 2. If I were the company management, I would take some steps to change the attitude towards Andrea’s return when I recognized that few people were enthusiastic about this thing. The organizational culture, attitude, and spirits need to be changed by management team. I need to set new compensation and incentive systems for the returned employees who have successfully finished the overseas assignments and increased the market shares and profit margins. As many companies grow across the globe, the company should pay more attention on hiring employees who have global business skills. 3. Andrea’s work experience abroad is critical and necessary for the company who expand its market share across abroad. Working in another country can open up opportunities to develop new skills and have new experiences. From the employer’s perspective, clients are looking for professionals......

Words: 418 - Pages: 2

Free Essay


...554 0800 Fax: +44 (0)207 554 5136 University Application Service Agreement Party A: Party B: Date of Birth Day____ Month ____ Year_____ Overseas Student Service Centre Ltd. Service Agreement Reference Number: L000_______ ID/Passport Number: Sex: Email: Contact Telephone Number Male □ Female □ Current or most recent School: English Replacement Test Result: Correspondence Address: Party A agrees to perform the following services for party A:  To liaise with partner universities on behalf of Party B  To advise of educational opportunities  To provide university application forms in tangible or electronic form  To assist the completion of university application forms for the 3 universities selected by Party B  To liaise between the embassy and university on behalf of Party B  To provide basic advice on visa application  To preparing for university interviews if necessary  To assist Party B in accepting university offers  To arrange airport pickup  To assist arranging accommodation  To assist with university enrollment Party B agrees to provide the following for Party A:  A deposit of £100.00, to be returned after successful entry into a partner institution of Party A.  An administration fee of £50 for every extra university application (the first three applications are free)  True and accurate documents relating to their university application including academic certificates, identity documents and personal statements)......

Words: 772 - Pages: 4