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
what is means with respect to software engineering?

Following are some causes why we use threads in designing operating systems. A process with several threads makes a great server for instance printer server. For the reason that t

Suppose you are designing a database for an art museum that owns a large volume of works of art. Each work of art is described by a unique item code, a title, a type, and a size. T

what is the first computer in this world

create a flowchart showing average score for the 3 quizzes assume that there are 3 sections each having 5 students the only valid number to be entered is 1-100 for the quizzes shou

change 778 into binarynumber

Dictionary values encompass no limitations. They can be any random Python object, moreover standard objects or user-defined objects. Though, same is not true for the keys. There ar

Data communication as a need developed in the 1960s with the interconnection of peripheral devices to mainframe computers. Within the immediate vicinity of the mainframe computer t

mention the aims of education in present scenario

write a basic program for f= a+b+c//2