Scheme, computer science, Basic Computer Science

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)
(path? ''(5 ((1 2)(3 4)(3 5)(4 5))) 1 5)

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).
path(graph(5, [[1,2],[3,4],[3,5],[4,5]]), 1 5).
Posted Date: 2/24/2012 10:23:35 AM | Location : United States

Related Discussions:- Scheme, computer science, Assignment Help, Ask Question on Scheme, computer science, Get Answer, Expert's Help, Scheme, computer science Discussions

Write discussion on Scheme, computer science
Your posts are moderated
Related Questions
Question 1 Explain the concept of knowledge discovery in database Question 2 Discuss the following types of Multidimensional Data Models                    Stars, Snowflakes and

Program and Programming Language : A Program is defined as a collection of statements/ instructions that enable the computer to solve a problem. The process of writing a prog

The three main elements of the control unit are: 1. Decoder this is used to decode the instructions that create a program when they are being processed, and to establish in what ac

Memory : Computers store information internally as well as externally. Linked to CPU is an internal memory unit where all the instructions and data are stored. It contains the

The client-server model firmly differentiates the roles of the client and server. According to this model, the client requests services that are provided by the server. The peer-to

R e presentations/Languages Used: Many people are taught Artificial Intelligence with the opening line: "The three most essential things in Artificial Intelligence are repres

QUESTION (a) Explain what is RMI? (b) Draw a diagram showing the different parts of the Java RMI architecture. (c) What is the function of the RMI security manager and RM

Here are the more specific requirements and the related points - use the below as a check-off list when you make your presentation.  Please note . . . many of the requirements are

to do a assignment regarding IPC in linux

Purpose of Code This is a short program to practice assembly language loops and if/else statements. You will use various jump commands and the cmp instruction.  The progra