473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

vb.net code for advanced data structures

Hi!

Actually I have to solve the following problems:

Given is a dynamic set S of (moving, vanishing and arising) points
(2D). It could be the case that |S|>100 or even >1000 but not >20000.
In general almost all of the current members of S are moving all the
time.

For a single point p of S I want to find

A) All other points which are in a given circle around p
B) The nearest neighbor of p

I think a voronoi partition of the plane with respect to S should be
the key to solve the problem. So I look for a vb implementation of this
algorithm. It would be fine to have an algorithm which also can handle
insert and delete of points and which is able to deliver an almost
correct voronoi diagram for moved objects without a complete new
calculation if the shift is sufficient small.

Can anybody help?

GFM GToeroe

Jun 13 '06 #1
4 1657
Not sure if Delaunay Triangluation could help but this article says it"s
closely related and it have several implementations :
http://astronomy.swin.edu.au/~pbourk...g/triangulate/

If not already done I would start by the more straightforward algo and would
switch to a more elvoved one if really needed (for example you could quickly
test the difference in x and y to quickly reject points and you have to
compute the exact distance only for those who could match).

Good luck.

--
Patrice

"GFM GToeroe" <gf*@gtoeroe.de> a écrit dans le message de news:
11*********************@g10g2000cwb.googlegroups.c om...
Hi!

Actually I have to solve the following problems:

Given is a dynamic set S of (moving, vanishing and arising) points
(2D). It could be the case that |S|>100 or even >1000 but not >20000.
In general almost all of the current members of S are moving all the
time.

For a single point p of S I want to find

A) All other points which are in a given circle around p
B) The nearest neighbor of p

I think a voronoi partition of the plane with respect to S should be
the key to solve the problem. So I look for a vb implementation of this
algorithm. It would be fine to have an algorithm which also can handle
insert and delete of points and which is able to deliver an almost
correct voronoi diagram for moved objects without a complete new
calculation if the shift is sufficient small.

Can anybody help?

GFM GToeroe

Jun 13 '06 #2
> Given is a dynamic set S of (moving, vanishing and arising) points
(2D). It could be the case that |S|>100 or even >1000 but not >20000.
In general almost all of the current members of S are moving all the
time.

For a single point p of S I want to find

A) All other points which are in a given circle around p
B) The nearest neighbor of p

I think a voronoi partition of the plane with respect to S should be
the key to solve the problem.


I think not, because cell phone masts dont move, but your points do. I
would use square grids for this problem. Represent your set S as a
collection of collections. Let S be a collection keyed on the grid (eg by
the grid's center x,y). Within each of these collections are all of the
points that are currently contained in the grid. As a point moves from one
grid to another, you have to remove it from one collection and add it to
another. Don't make the grids too small or you will spend too much time
moving points from one grid to another.

To find all points at a given distance or less from point P, you can
calculate which grids need to be checked, and then use brute force code to
check all points in the relevant grids. Don't make the grids too big or you
will gain no search advantage (ie you will check many more points than you
really need to).
Jun 13 '06 #3
Not sure if I understand your problem exactly but given a point "p", you
might consider:

Keep a grid and every time a point is entered, set it's grid number then for
the point, Calculate the distances beween p and all the other points in the
grid to find the ones which are within the circle radius distance and keeping
track of the minimum distance.

--
Dennis in Houston
"GFM GToeroe" wrote:
Hi!

Actually I have to solve the following problems:

Given is a dynamic set S of (moving, vanishing and arising) points
(2D). It could be the case that |S|>100 or even >1000 but not >20000.
In general almost all of the current members of S are moving all the
time.

For a single point p of S I want to find

A) All other points which are in a given circle around p
B) The nearest neighbor of p

I think a voronoi partition of the plane with respect to S should be
the key to solve the problem. So I look for a vb implementation of this
algorithm. It would be fine to have an algorithm which also can handle
insert and delete of points and which is able to deliver an almost
correct voronoi diagram for moved objects without a complete new
calculation if the shift is sufficient small.

Can anybody help?

GFM GToeroe

Jun 14 '06 #4

Dennis schrieb:
Not sure if I understand your problem exactly but given a point "p", you
might consider:

Keep a grid and every time a point is entered, set it's grid number then for
the point, Calculate the distances beween p and all the other points in the
grid to find the ones which are within the circle radius distance and keeping
track of the minimum distance.

--
Dennis in Houston
"GFM GToeroe" wrote:
Hi!

Actually I have to solve the following problems:

Given is a dynamic set S of (moving, vanishing and arising) points
(2D). It could be the case that |S|>100 or even >1000 but not >20000.
In general almost all of the current members of S are moving all the
time.

For a single point p of S I want to find

A) All other points which are in a given circle around p
B) The nearest neighbor of p

I think a voronoi partition of the plane with respect to S should be
the key to solve the problem. So I look for a vb implementation of this
algorithm. It would be fine to have an algorithm which also can handle
insert and delete of points and which is able to deliver an almost
correct voronoi diagram for moved objects without a complete new
calculation if the shift is sufficient small.

Can anybody help?

GFM GToeroe


Yes, this is the street I'm currently going on. Because I figured out
another problem: The data is often clustered very high as the points
stand for example for swarms or objects which chase all the same prey.

So I will work with a list of lists defined by a dynamic grid which is
binded to a suited function of the max speed the objects can have. Also
I will research if lists which contain the objects sorted tby x,y,r,phi
could improve the algorithm.

Thanks to all

Gabor

Jun 14 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
0
by: Jason Sirota | last post by:
I am an advanced database and vb programmer but recently my position has called for advanced archtecture descisions enterprise-wide. Although I have quite a bit of knowledge on designing relational...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
10
by: jeff regoord | last post by:
A user inputs a float value. The scanf() function gets the value. However, I need to create an error handler with an if else statement saying invalid input if the input is not a number. Does...
6
by: Walid | last post by:
Hi, Any suggestion for a good C# book for advanced level. thnx
68
by: pemo | last post by:
What would expect to be covered? Say you'd already attended a course, that had covered stuff like structs, pointers, bitwise and logical operators, multi-demensional arrays , *but* hadn't covered...
6
by: TPJ | last post by:
Help me please, because I really don't get it. I think it's some stupid mistake I make, but I just can't find it. I have been thinking about it for three days so far and I still haven't found any...
11
by: efrat | last post by:
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.