Scheme, computer science, Basic Computer Science

Assignment Help:
There is a path between two vertices if there is a series of edges that you can use to travel between them. For example, between vertices 1 and 3 above, there is a path made up of the edges (1 2) and (2 3), written ((1 2)(2 3)). A path may not include repeated vertices.
Write two functions: in Scheme, a predicate path?, which takes a graph and two numbers indicating vertices, which returns true iff there is a path between them.:

(path? ''(5 ((1 2)(2 3)(3 4)(3 5)(4 5))) 1 5)
#t
(path? ''(5 ((1 2)(3 4)(3 5)(4 5))) 1 5)
#f

In Prolog, write a query path(+G, +V1, +V2) which succeeds iff there is a path in graph G between vertices V1 and V2.

path(graph(5, [[1,2],[2,3],[3,4],[3,5],[4,5]]), 1 5).
true.
path(graph(5, [[1,2],[3,4],[3,5],[4,5]]), 1 5).
false.

Related Discussions:- Scheme, computer science

Device drivers, Device Drivers:   Device drivers are shared computer p...

Device Drivers:   Device drivers are shared computer programs that provide an interface between the hardware devices and operating system or other higher level programs.

Assignment, Assignment of computer science

Assignment of computer science

Explain data transfer and arithmetic operations, Question 1 Convert the fo...

Question 1 Convert the following binary numbers to decimal 101110 1110101 110110 101010 110010 Question 2 Explain CPU module and types of transfers betwe

What is Load and store the assembly programs?, It would not emerge practica...

It would not emerge practical to type an entire program each time it is required, and to avoid this it is possible to store a program on the disk, with the vast advantage that by b

Assignment of making a small database, assignment of making a small databas...

assignment of making a small database in C# with a back end support of MS Access. i required a form with following options : Enter a new user (user name, father name, age, d

Basic, WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL M...

WAP TO ACCEPT MARKS OF THREE SUBJECT FOR STUDENT & CALCULATE TOTAL MARKS AND PERCENTAGE

Search problems in artificial intelligence, Specifying Search Problems ...

Specifying Search Problems In our agent terms, a problem to be solved is a particular task where the agent starts with the environment in a given state and acts upon the enviro

Data transmission, #quesetion..explain the concept of data transmission giv...

#quesetion..explain the concept of data transmission giving details of the transmission rate and bandwidth with details explanation of the transmission media

Write Your Message!

Captcha
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