ask for help on algorithm to trace a network

J

Julia

Hi, there,

My task is:

There is a network of intersected lines, e.g., a road network. What I
have is a list of lines, and each item in the list includes the
coordinates of points on each line.

I need an algorithm to trace the whole network, find the intersections
of all the lines, and record the lengths between two different
intersections or between an intersection and an endpoint of a line. Can
you help me out to design an efficient algorithm to do this? Any
suggestaions on the algorithms and data structures would be highly
appreciated. If you could write it in pseudo-code, that would be even
better.

Thanks a lot,

JJ
 
V

Vladimir S. Oka

Julia said:
Hi, there,

My task is:

There is a network of intersected lines, e.g., a road network. What I
have is a list of lines, and each item in the list includes the
coordinates of points on each line.

I need an algorithm to trace the whole network, find the intersections
of all the lines, and record the lengths between two different
intersections or between an intersection and an endpoint of a line. Can
you help me out to design an efficient algorithm to do this? Any
suggestaions on the algorithms and data structures would be highly
appreciated. If you could write it in pseudo-code, that would be even
better.

Thanks a lot,

JJ

The place for this question is more likely comp.programming. I
have added follow-up to it.

Cheers

Vladimir
 
M

Mike Wahler

Julia said:
Hi, there,

My task is:

There is a network of intersected lines, e.g., a road network. What I
have is a list of lines, and each item in the list includes the
coordinates of points on each line.

I need an algorithm to trace the whole network, find the intersections
of all the lines, and record the lengths between two different
intersections or between an intersection and an endpoint of a line. Can
you help me out to design an efficient algorithm to do this? Any
suggestaions on the algorithms and data structures would be highly
appreciated. If you could write it in pseudo-code, that would be even
better.

I think an algebra text should have all the information you need.

Note that this newsgroup is not about algorithms, but the ISO
standard C language. Once you've located or devised an algorithm,
you can translate it to C. If you need help with the C code, then
post the pertinent portions and we'll try to help.

Purpose of comp.lang.c:
http://www.ungerhu.com/jxh/clc.welcome.txt

C FAQ:
http://c-faq.com/

-Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,173
Messages
2,570,937
Members
47,481
Latest member
ElviraDoug

Latest Threads

Top