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

Bootstrap loader, Bootstrap loader: The critical programs are loaded i...

Bootstrap loader: The critical programs are loaded into memory by the bootstrap loader at start-up time and will remain resident as long as the computer is running. The bootst

Which port does FTP uses, Why is it called out of band protocol? A1) FTP us...

Why is it called out of band protocol? A1) FTP uses port 20 and port 21; port 20 is used for data connection, whereas port 21 is used for control connection. FTP is known as out-of

Function, function of arithmetic logic unit

function of arithmetic logic unit

Ricochet wireless data network, The Internet is replete with great success ...

The Internet is replete with great success stories and sad failures. While it is always nice to hear about the successes, more can probably be learned from the failures. In this ca

Data base, advantages of file base system

advantages of file base system

Systems software, Systems Software: Systems software is generally supp...

Systems Software: Systems software is generally supplied by the hardware manufacturers. It includes operating systems, assemblers, compilers, and interpreters (to convert prog

Design Buffer Last-in First-out, i want design circuit this Buffer(LIFO).pl...

i want design circuit this Buffer(LIFO).please help me

Working of web browser, Working of web Browser:   Internet is character...

Working of web Browser:   Internet is characterized by the Client Server Computing that consists of three basic components: The Web client which may be the web browser;

The elif Statement, The elif statement permits you to check multiple expres...

The elif statement permits you to check multiple expressions for truth value and execute a block of code the moment one of the conditions estimates to true. similar to the else, th

Time sharing, Time Sharing Time sharing allows a large number of users ...

Time Sharing Time sharing allows a large number of users at various remote terminals to simultaneously use a centrally located computer for problem solving. Each user operates

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