0% found this document useful (0 votes)
429 views3 pages

CSE 4308 - Assignment 1

This document provides instructions for Assignment 1, which involves implementing uniform cost search to find routes between cities in a road network. Students must write a program called find_route that takes an input file name, origin city, and destination city as command line arguments and outputs the route distance and cities. The program will be graded out of 100 points based on correctly finding optimal routes when they exist and reporting no route when none exists. Code must be submitted as assignment1.zip and include compilation instructions in readme.txt.

Uploaded by

Brandon Lawrence
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
429 views3 pages

CSE 4308 - Assignment 1

This document provides instructions for Assignment 1, which involves implementing uniform cost search to find routes between cities in a road network. Students must write a program called find_route that takes an input file name, origin city, and destination city as command line arguments and outputs the route distance and cities. The program will be graded out of 100 points based on correctly finding optimal routes when they exist and reporting no route when none exists. Code must be submitted as assignment1.zip and include compilation instructions in readme.txt.

Uploaded by

Brandon Lawrence
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CSE4308AssignmentsAssignment1

Listofassignmentduedates.

Figure1:Avisualrepresentationoftheroadsystemdescribedinfileinput1.txt.

Task:UniformCostSear ch
Implementuniformcostsearchforaprogramthatcanfindaroutebetweenanytwocities.Yourprogramwillbe
calledfind_route,andwilltakeexactlythreecommandlinearguments,asfollows:
find_routeinput_filenameorigin_citydestination_city

Anexamplecommandlineis:
find_routeinput1.txtMunichBerlin

Argumentinput_filenameisthenameofatextfilesuchasinput1.txt,thatdescribesroadconnectionsbetween
citiesinsomepartoftheworld.Forexample,theroadsystemdescribedbyfileinput1.txtcanbevisualizedin
Figure1shownabove.Youcanassumethattheinputfileisformattedinthesamewayasinput1.txt:eachline
containsthreeitems.Thelastlinecontainstheitems"ENDOFINPUT",andthatishowtheprogramcandetect
thatithasreachedtheendofthefile.Theotherlinesofthefilecontain,inthisorder,asourcecity,adestination

city,andthelengthinkilometersoftheroadconnectingdirectlythosetwocities.Eachcitynamewillbeasingle
word(forexample,wewilluseNew_YorkinsteadofNewYork),consistingofupperandlowercaselettersand
possiblyunderscores.
IMPORTANTNOTE:MULTIPLEINPUTFILESWILLBEUSEDTOGRADETHEASSIGNMENT,FILE
input1.txtISJUSTANEXAMPLE.YOURCODESHOULDWORKWITHANYINPUTFILE
FORMATTEDASSPECIFIEDABOVE.
Theprogramwillcomputearoutebetweentheorigincityandthedestinationcity,andwillprintoutboththe
lengthoftherouteandthelistofallcitiesthatlieonthatroute.Forexample,
find_routeinput1.txtBremenFrankfurt

shouldhavethefollowing:
distance:455km
route:
BrementoDortmund,234km
DortmundtoFrankfurt,221km

and
find_routeinput1.txtLondonFrankfurt

shouldhavethefollowingoutput:
distance:infinity
route:
none

Forfullcredit,youshouldproduceoutputsidenticalinformattotheabovetwoexamples.

Suggestions
Thecodeneedstorunonomega.Ifyouhavenoteventriedlogginginonomegauntilthelastday,thereisa
highprobabilitythatsomethingwillgowrong.Youmayfinditconvenienttodothecodedevelopmentand
testingonyourownlaptoporhomemachine,butitishighlyrecommendedthatyoulogintoomegaand
compileatoyprogramASAP,andthatyoucompileandrunanintermediateversionofyourcodewellbeforethe
deadline.NotifytheinstructorandTAforanyproblemsyoumayhave.
Paycloseattentiontoallspecificationsonthispage,includingspecificationsaboutoutputformat,submission
format.Evenincaseswheretheprogramworkscorrectly,pointswillbetakenofffornoncompliancewiththe
instructionsgivenonthispage(suchasadifferentformatfortheprogramoutput,wrongcompressionformatfor
thesubmittedcode,andsoon).Thereasonisthatnoncompliancewiththeinstructionsmakesthegrading
processsignificantly(andunnecessarily)moretimeconsuming.

Grading
Theassignmentswillbegradedoutof100points.
40points:Theprogramalwaysfindsaroutebetweentheoriginandthedestination,aslongassucha
routeexists.
30points:Inadditiontotheaboverequirement,theprogramterminatesandreportsthatnoroutecanbe
foundwhenindeednorouteexiststhatconnectssourceanddestination(e.g.,ifsourceisLondonand
destinationisBerlin,intheaboveexample).

30points:Inadditiontotheaboverequirements,theprogramalwaysreturnsoptimalroutes.Inother
words,noshorterrouteexiststhantheonereportedbytheprogram.
Negativepoints:penaltypointswillbeawardedbytheinstructorandTAgenerouslyandatwill,forissues
suchas:codenotrunningonomega,submissionnotincludingpreciseandaccurateinstructionsforhowto
runthecode,wrongcompressionformatforthesubmission,orotherfailurestocomplywiththe
instructionsgivenforthisassignment.PartialcreditforincorrectsolutionswillbegivenONLYforcode
thatiswelldesignedandwelldocumented.Codethatisbadlydesignedandbadlydocumentedcanstill
getfullcreditaslongasitaccomplishestherequiredtasks.

Howtosubmit
ImplementationsinC,C++,Java,andPythonwillbeaccepted.Ifyouwouldliketouseanotherlanguage,please
firstcheckwiththeinstructorviaemail.Pointswillbetakenoffforfailuretocomplywiththisrequirement.
TheassignmentshouldbesubmittedviaBlackboard.SubmitaZIPPEDdirectorycalledassignment1.zip(no
otherformsofcompressionaccepted,contacttheinstructororTAifyoudonotknowhowtoproduce.zipfiles).
Thedirectoryshouldcontainonlysourcecode,nobinaries.Thesubmissionshouldalsocontainafilecalled
readme.txt,whichshouldspecifyprecisely:
NameandUTAIDofthestudent.
Whatprogramminglanguageisused.
Howtorunthecode,includingveryspecificcompilationinstructions,ifcompilationisneeded.
Instructionssuchas"compileusingg++"areNOTconsideredspecific.
Insufficientorunclearinstructionswillbepenalizedbyupto20points.Codethatdoesnotrunonomega
machinesgetsATMOSThalfcredit(50points).

Submissionchecklist
Isthecoderunningonomega?
Didyousubmityoursourcecode?
Doesthesubmissionincludeareadme.txtfile,asspecified?

You might also like