What is the time complexity of your algorithm

Assignment Help Computer Engineering
Reference no: EM131766152

Project - Graph Traversal

1 Overview

This project requires you to model the problem below as a graph and then use a known graph algorithm to solve the problem (you can pick any algorithm you want).

You must traverse a field of arrows (red or blue). You must find a route from the arrow in the top left corner to the bulls-eye in the bottom right corner. You must follow the direction that the arrows point, and you can only stop on the other colored arrow. For example, start on red, then chose a blue arrow (in the direction that the red arrow is pointing), then from the blue arrow chose a red arrow in the direction the blue arrow is pointing. Continue in this fashion until you find the bulls-eye in the bottom right corner. You may find your-self in a loop and continuously visiting the same arrows. You must find the correct path.

2 Report

You must include a report with your project. It will include the team members names along with their contribution to the project, programming language used (C++ or Java), detailed instructions on how to compile and run your program, and you must also answer the following questions.

a) What type of graph did you use for the problem and how did you construct the graph (what do the vertices, edges, etc. correspond to)?

b) Which algorithm did you use? Describe it in pseudocode.

c) What is the time complexity of your algorithm?

You must implement the programming aspect of this project in either C++ or Java. The only rules for your program are that it must take a text file as input, and write the results of the program to a text file as output. The name of the input and output files need to be given to the program as command line parameters. For example: GraphTraversal input.txt output.txt

Input file format

Your program should read its input from a file with the following format. The input begins with two positive characters on a line indicating the number of rows r and columns c of the maze, respectively. The next r lines contain the color and directional information for each arrow in the maze. Each line has c values, where each value represents the color of the arrow by the direction of the arrow (N, E, S, W, NE, SE, SW, or NW). The color codes R and B represent red and blue, respectively, while the direction codes represent north, east, south, west, northeast, southeast, southwest, or northwest, respectively. The bulls-eye is represented by the letter O. You may assume that the bulls-eye will always be in the bottom-right corner of the maze.

8 8





R-E  Ft-SE  B-S  B-SW  R-S  Ft-SW  Ft-S  Ft-S 
B-E  R-S  B-SE  R-E  B-SE  B-S  B-W  Ft-SW 
R-N  B-W  B-SW  Ft-SE  Ft-NE  B-SW  B-W  Ft-W 
R-SE  Ft-SE  B-SW  Ft-SE  Ft-S  B-NW  R-E  B-NW 
B-NE  R-W  Ft-S  B-S  B-E  B-NE  B-NW  Ft-NW 
R-S  B-SE  R-SE  Ft-SE  R-NW  R-NE  B-E  R-W 
R-NE  B-W  B-SE  R-E  R-E  B-E  B-NW  Ft-SW 
B-NE R-E B-N Ft-NE B-NE B-N B-NW 0

Output file format
You must write the output file in the following format. The output will consist of a path from the top left square to the bottom right square (bulls-eye). Write a single line consisting of a sequence of moves, separated by spaces. Each move should be represented by the number of spaces to move and the direction, with no spaces in between. The direction should be represented using N, E, S, W, NE, SE, SW, and NW, as in the input. The sequence of moves must solve the maze from the input. You will be given multiple mazes to test, along with the solutions so you can check your answers.

For example, if your first 3 moves take you 3 spaces east, 3 spaces southwest, and 4 spaces southeast, your output should begin as follows:
3E 3SW 4SE

Reference no: EM131766152

Questions Cloud

What force did the paddle apply to the puck : When the force is removed the puck is travelling at a speed of 15.8 m/s. What force did the paddle apply to the puck?
Describe the purpose of learner assessments : Describe the purpose of learner assessments and how self-regulation positively affects the outcomes.
Calculate the potential bad debt : If company uses the percentage of credit sales to calculate the potential bad debt what is one side of a transaction for a company with the following.
Find the frequency heard by a stationary observer : Find the frequency heard by a stationary observer as the train approaches and as the train move away?
What is the time complexity of your algorithm : COT 4400 - What type of graph did you use for the problem and how did you construct the graph (what do the vertices, edges, etc. correspond to)
Determine depreciation expense on the asset : Company Z sold a half-depreciated asset with an original cost of $40,000 and annual depreciation of $4,000 to T company for $9,000.
Discuss about the leadership communication skills : Is individual communication more important than group or mass communication? Why or why not?
Rocket above the earth surface : What is the maximum height of the rocket above the earth's surface (using the initial rocket mass of $)
List goals that client will identify for successful recovery : List two goals that the client will identify for successful recovery. List two example of how members were engaged in their recovery goals to maintain sobriety.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd