美文网首页
代写CompSci 367/761作业、代做Java/Pytho

代写CompSci 367/761作业、代做Java/Pytho

作者: fujianjia | 来源:发表于2019-08-25 09:52 被阅读0次

CompSci 367/761 ASSIGNMENT 2: TRAVELLING SALESPERSONPROBLEM (TSP) : FINDING OPTIMAL TOURDue 27 August 11:59PM worth 5%.1 IntroductionThis assignment will be released in stages. This phase of the assignment will introduceyou to the problem you are to solve. The next phase will introduce youto example road networks. These example road networks will provide you withtest cases for your code. The final phase will provide the wrapper prolog codethat will use your code to find the optimal tour for a TSP. Phase 2 will be availableon Monday 5 August and the final phase will be available on Wednesday7 August. You can begin trying to understand the assignment now. However,the asignment should become clearer as you learn prolog in the tutorial and thelectures this week. Please use Piazza to ask questions about and to discuss theassignments.1. Declarative ProgrammingThe goal of declarative programming is to separate the what from the how.When you were programming the logic puzzle in assignment 1, you weredoing, to a large extent, declarative programming. A large part of yourprogram described what relationships must exist between the values ofdifferent variables. You did not describe how to find those values.In this assignment, you will be describing what it means for a list of citiesto be a tour for a given start city and a road network. You should NOTbe describing how that tour is found.2. ContextIn this assignment you need to write prolog code to generate solutions forthe asymmetric travelling salesman problem (see https://en.wikipedia.org/wiki/Travelling_salesman_problem#Description). The goal is towrite a prototype solver for travelling salesman problems. Your assignmentis make the code as declarative and as obviously correct as possible.Efficiency is of no concern here. Basically your code will define which itmeans for a list of cities to be a tour of a road network starting from andending at a specified city.3. Inputs and OutputsYou must write the code for:solution(+Path, +RoadNetwork, -SolutionCost, -SolutionPath).See Notation of Predicate Descriptions (https://www.swi-prolog.org/pldoc/man?section=preddesc) for descriptions of the meaning of +and - in front of the argument names.The inputs are:1Path a list of cities, in reverse order of being visited (e.g., the last city inthe list is the first city in the tourRoadNetwork a description of all the directed roads between cities andtheir costThe outputs are:SolutionCost the cost of a tour of network;SolutionPath the tour for which SolutionCost was computed.2 Domain Description1. Road NetworkThe road network is a directed asymmetric weighted graph, the graph isnot nessarily complete (i.e., there need not be edges between every twonodes in the graph). The interpretation is that the nodes are cities, theedges are one-way roads, and an edge weight is the distance between thetwo edge nodes (i.e., cities) in that direction. For example, the roadbetween city a and city b might have cost 5 and the road between cityb and city a might have cost 2 (or there might not a road going fromcity b to city a).2. Tour DefinitionGiven a starting city and a road network, a tour is defined as follows. Atour is defined to be a list of cities, such that: every city in the network appears in the list at least once; only the starting city can appear in the list more than once; the starting city is both the first and the last element in the list; the starting city appears in the list exactly twice.the list contains exactly one more element than the number of distinctcities in the road network.For example, for a road network that only contains one city, there wouldonly be one tour with two elements, that city appearing twice, e.g., let thecity be a, then the tour is the list [a, a]. Note that since the graph neednot be complete, not all road networks have tours. In this case, solution/4(the predicate solution with 4 arguments) should simply fail.The cost of a tour is the sum of the edge costs between the successivenodes in the tour list. The distance between any city and itself is zero.Therefore the cost of the tour [a, a] is 0. If there were two cities, a and b,and the distance from a to b is 4 and the distance from b to a is 3, and ais the starting city then the only legal tour is the list [a, b, a], which hasa cost of 7. If there were no road (edge) from b to a then solution/4 willfail.2本团队核心人员组成主要包括BAT一线工程师,精通德英语!我们主要业务范围是代做编程大作业、课程设计等等。我们的方向领域:window编程 数值算法 AI人工智能 金融统计 计量分析 大数据 网络编程 WEB编程 通讯编程 游戏编程多媒体linux 外挂编程 程序API图像处理 嵌入式/单片机 数据库编程 控制台 进程与线程 网络安全 汇编语言 硬件编程 软件设计 工程标准规等。其中代写编程、代写程序、代写留学生程序作业语言或工具包括但不限于以下范围:C/C++/C#代写Java代写IT代写Python代写辅导编程作业Matlab代写Haskell代写Processing代写Linux环境搭建Rust代写Data Structure Assginment 数据结构代写MIPS代写Machine Learning 作业 代写Oracle/SQL/PostgreSQL/Pig 数据库代写/代做/辅导Web开发、网站开发、网站作业ASP.NET网站开发Finance Insurace Statistics统计、回归、迭代Prolog代写Computer Computational method代做因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp

相关文章

网友评论

      本文标题:代写CompSci 367/761作业、代做Java/Pytho

      本文链接:https://www.haomeiwen.com/subject/grhhectx.html