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

Necessary nurses records, Necessary Nurses Records The software shoul...

Necessary Nurses Records The software should generate all registers/reports in detail summary for various permutations and combinations of options. A powerful SQL (Structure

Html, a program to create htmlpage

a program to create htmlpage

Compiler, Compiler A compiler is a special program which transla...

Compiler A compiler is a special program which translates programs written in high level language into machine language. The original program is called the source progra

Qbasic, write a program of circle of any colour

write a program of circle of any colour

How is the ack request formed, QUESTION a) The handling of the INVITE t...

QUESTION a) The handling of the INVITE transaction in SIP is completely different from the handling of other transactions. The handling of the INVITE is one of the most complex

Computer programming, outline and explain in detail any 10 application area...

outline and explain in detail any 10 application areas of vb.net

Operation system, how to create 1000 random processes with time scales betw...

how to create 1000 random processes with time scales between 10 to 400 milliseconds

Algorithm, solve three given number in ascending order through algorithm

solve three given number in ascending order through algorithm

Types of software interface, different types of software interfaces which f...

different types of software interfaces which falls in different categories

Computer help, Computer Help Inc. is a computer timesharing, and software d...

Computer Help Inc. is a computer timesharing, and software development and sales company. It has been successful in attracting clients for both sides of its business. Staff count

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