Re: Neighbors of a Vertex
- From: Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx>
- Date: Tue, 13 Nov 2007 21:06:08 -0600
Alf P. Steinbach wrote:
* Logan Shaw:Mark P wrote:Sam wrote:
I have a question about finding neighbors of a given vertex in a
graph.
Suppose there are n vertices in the graph, for one vertex P(x,y), how
can I find all its neighbors, which are away AT MOST r units from
P(x,y), in an efficient way, i.e. I don't want to compare the
distances of all possible pairs with P, which will take theta(n) time.
What do you mean by neighbors?
the poster is probably wanting us to assume that
vertexes are points in two-dimension space. Hence the notation "P(x,y)"
with no definition of "x" or "y"; we are apparently to assume they are
coordinates. This makes a lot of sense except for one thing: if that's
the case and if we look at the rest of the question, it's completely,
totally, 100% a red herring to mention that this is a graph. It's
really then a question about a set of points.
One reasonable interpretation is that each edge defines a distance.
If the distance is a property of the edge, then why do the vertexes
have x and y values?
Or I suppose it could be that the data structure is such that the
distances are stored on the edges, but it just so happens that this
is not the general case of a graph with weighted edges: instead, it
would be a graph where the weights obey the constraint that all the
vertexes could be points in 2-D space and the weights would correspond
to distance.
- Logan
.
- References:
- Neighbors of a Vertex
- From: Sam
- Re: Neighbors of a Vertex
- From: Mark P
- Re: Neighbors of a Vertex
- From: Logan Shaw
- Re: Neighbors of a Vertex
- From: Alf P. Steinbach
- Neighbors of a Vertex
- Prev by Date: Re: Neighbors of a Vertex
- Next by Date: Re: not to show menubar,addressbar & etc of browser without any security confirm
- Previous by thread: Re: Neighbors of a Vertex
- Index(es):
Relevant Pages
|