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

Batch processing, Batch Processing When the entire computer system is d...

Batch Processing When the entire computer system is dedicated to a single job, the system is said to be operating in Batch Processing mode. In this mode each program is run to

Describe Priority Scheduling algorithm of operating system?, Priority Sched...

Priority Scheduling • The fundamental idea is straightforward: each process is assigned a priority, and priority is permitted to run. Equal-Priority processes are scheduled in FCF

Software engineering, how will a poorly conducted feasibility study affect ...

how will a poorly conducted feasibility study affect an implemented system

Digital design system, Manipulate the following Boolean expression in such ...

Manipulate the following Boolean expression in such a way so that it can be implemented using exclusive-OR and AND gates only. AB''CD'' + A ''BCD'' + AB''C''D + A''BC''D

Multiple allocations, You can also allocate a single value to several varia...

You can also allocate a single value to several variables at the same time. For instance: X=y=z =1 Now, an integer object is generated with the value 1, and all three variables are

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

Write a brief note on firewalls, Question 1 Explain the TCP/IP protocol la...

Question 1 Explain the TCP/IP protocol layers Question 2 Write a note Fiber Distributed Data Interface (FDDI) Question 3 Discuss on File Transfer Protocol (FTP)

Information security, can someone balance between information security and ...

can someone balance between information security and access, if yes,how can they balance?

Summery, This is an article and I want great synopsis for the article

This is an article and I want great synopsis for the article

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