Shortest path calculation in huge spatial network

Looks like I have to load the whole network in order to perform shortest path calculation.
such as NetworkManager.shortestPathAStar, NetworkManager.shortestPath
Suppose the network is too big to be loaded at one time, what is the possible solution in Oracle spatial to solve this issue???

I can’t think of a way of analysing the network in chunks as it would increase the complexity of the calculation and may miss routes. If you know the start and end point have you considered drawing a connecting line between the two, buffering it and just loading the network inside the area.
You would need to check the route by increasing the buffer size and finding the shortest route again.
Another option could be to divide the network into primary and secondary routes. Find the route from the start to the nearest primary node and from the end point to the nearest primary point then connect the primary nodes. Based in a quick Google this is sounds a bit like the algorithms Garmin and Tom Tom use.
Message was edited by:
grahamallan

Similar Messages

  • Path direction in Oracle spatial network data model

    Hi all,
    can any one help me how to implement path direction using oracle network data Model?
    We are using Oracle Spatial database. there is one feature called network constraint in Network data Model. but how to implement path direction of my Network ? Please help me any one

    The path direction in a Spatial network is enabled at creation time when calling the create network procedure such as SDO_NET.CREATE_LOGICAL_NETWORK. If you describe the Create procedure you're using you should see a IS_DIRECTED argument, which when set to TRUE will enable path direction. Then just ensure that your links are created in the right direction -specifying correct orientation for start node and end node.
    Cheers,
    Stuart.

  • How to find a nearest node in a spatial network?

    hi, friends,
    Are there any similar function as sdo_topp_map.get_nearest_work() in oracle network package?
    Now I only have a location rather than a node, are there any methods to find the nearest node in the network? so I could continue use SDO_NET_MEM.NETWORK_MANAGER.SHORTEST_PATH_DIJKSTRA() to ge the shortest path.
    Thanks!

    The network model network analysis comes since 11.1 or 11.2 with support for dynamic segmentation, meaning that the path analysis does not need to start or end at an explicit node, but can start or end anywhere on a link.
    This gives you 2 options either as you requested, search the closest node, if that is still what you are after
    Or
    From your point, find the nearest link, and the "projected" location of your point to that link. While doing so, you should get a measure (percentage factor between 0 and 1) which expresses the relative position on the link from the start point.
    For option 1. use the proposed solution from Farid
    For option 2. apply the same SDO_NN approach, but do that for the link table (finding the nearest link first), rather then the nearest node.
    Then you can get the measure using either:
    - http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_lrs_ref.htm#i85426
    SDO_LRS.FIND_MEASURE
    Or
    - http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11831/sdo_net_ref.htm#autoId55
    SDO_NET.GET_PERCENTAGE
    Or
    - http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11829/oracle/spatial/network/Link.html#computeDistanceRatio_double__double_
    computeDistanceRatio(double x, double y)
    With that measure you can apply the shortest path using the link Id and the additional measure factor as the start parameters:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11829/oracle/spatial/network/NetworkManager.html#shortestPath_oracle_spatial_network_Network__int__double__int__oracle_spatial_network_NetworkConstraint_
    shortestPath(Network network, int startLinkID, double startPercentage, int endNodeID, NetworkConstraint constraint)
    Again, it all depends on what your use case is. I hope this helps.
    Luc

  • Network Model - Shortest Path

    Hi all,
    I have created spatial network containing non lrs sdo_geometry objects in Oracle 10g (Release 2). In this network model there are 33208 nodes and 42406 links.
    Now I need to write a java program to find shortest route between two selected nodes. Here is snippet of my source code.
    Connection connection = DriverManager.getConnection(dbUrl, databaseUser,   databasePassword);
    boolean readForUpdate = false;
    Network net= NetworkManager.readNetwork(connection, "SDO_ROAD_NETWORK", readForUpdate);
    Path path = NetworkManager.shortestPath(net, startNodeId ,endNodeId);
    System.out.println ("total distance " path.getCost() );+
    Link[] linkArray = path.getLinkArray();
    But this will throws an exception - Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    It was working fine for 1000 nodes and 1000 links. I tried by changing java options like -Xms and Xmx parameters but same result.
    Then I tried to find shortest route using pl/sql using following.
    DECLARE
    testNet VARCHAR2(30) := 'SDO_ROAD_NETWORK';
    startNode NUMBER := 120150;
    endNode NUMBER :=1740034;
    path NUMBER;
    linkArray SDO_NUMBER_ARRAY;
    BEGIN
    sdo_net_mem.network_manager.read_network('SDO_ROAD_NETWORK', 'FALSE');
    dbms_output.put_line('Loading finished');
    path := SDO_NET_MEM.NETWORK_MANAGER.SHORTEST_PATH_DIJKSTRA('SDO_ROAD_NETWORK', startNode, endNode);
    IF path IS NULL THEN
    dbms_output.put_line('route not found');
    return;
    END IF;
    linkArray := SDO_NET_MEM.PATH.GET_LINK_IDS(testNet, path);
    FOR i IN linkArray.first..linkArray.last
    LOOP
    dbms_output.put_line('Link -- ' || linkArray(i) || ' ' ||
    SDO_NET_MEM.LINK.GET_NAME (testNet, linkArray(i)) || ' ' ||
    SDO_NET_MEM.LINK.GET_COST (testNet, linkArray(i)));
    END LOOP;
    END;
    +/+
    But this takes nearly 4 minutes to just read the nework (sdo_net_mem.network_manager.read_network).
    Finally I dowloaded standalone java client application NDM Network Editor from OTN. This application loads entire network within 25 seconds and finds shortest route within 5 seconds.
    Please guide me how can I write improved code reading network. My requirement is to get shortest path between two nodes
    Thanks,
    Sujnan

    Hi Sujnan
    In the past there have been some performance issue for the Oracle JVM. Not sure if this addressed in the latest releases (10.r2 or 11).
    Performance Status OJVM used for SDO Network data Model 10R2.0.2
    Maybe the oracle guys can give an update.
    Luc

  • LRS and network analysis like shortest path

    Does Spatial support/has function for network analysis, like fe. Shortest path?
    Maybe via the LRS?
    tx
    Luc VAN LINDEN

    Hi,
    This feature is not supported using any Oracle Spatial primitives. It is possible to manipulate geometries and get this information, but you would need to write your own functions.

  • Shortest path between two arbitrary point in the network

    Hi All,
    In oracle NDM, it's possible to find shortest path between two nodes (e.g. using SDO_NET_MEM.NETWORK_MANAGER.SHORTEST_PATH), but I need to find shortest path between 2 points which are on the network edges. I suppose I should use (Interface SubPath) in network java apis. However I want to do it via PLSQL api. Should I code it myself or there exists a function?
    Any help is appreciated.
    Edited by: Fa on Dec 15, 2011 2:51 AM

    pritamg wrote:
    I have to build an application in which the user will draw the graph by creating nodes and edges.and then the start node will be marked.Then the shortest paths to other nodes will be displayed.Give me any possible clue how to start.I am in deep deep trouble.I have to use Dijkstra's Algorithm.
    please help some one...pleaseDo you know Dijkstra's Algorithm for shortest path? I believe that one was also called the traveling salesman problem. You can easily Google to find out what it is.
    Did you listen to your instructor when he/she did his/her lectures on recursion and halting contitions? If not, then please go talk to him/her and read your book, the forum is not a place to try to learn a basic concept that you should have paid attention in class for the first time.
    If you have code and you have specific questions post them and we will be glad to help, but we are not here to develop your homework solutions for you, no matter how that may affect your future.

  • Dispay shortest path in MapViewer

    Hello,
    I had sucsessfully installed MapViewer 9.0.4 and Oracle Spatial 10g.
    here I would like to know how to make a shortest path query between two point in Oracle MapViewer and display it.
    Any help will be appreciated.
    regards
    aziz

    Hi Aziz,
    the next release of MapViewer will support the Network Model including requests ro render shortest paths.

  • Query for finding shortest path

    I know nothing about Oracle Spatial. Just want to know if this query is possible using Spatial.
    Given the following data for undirected weighted graph,
    v1: vertex 1
    v2: vertex 2
    w: weight between vertices v1 and v2(or, distance of edge)
    table name : wgraph
    v1  v2  w
    k   a    2
    m  a    3
    k   c    1
    k   d    4
    c   b    2
    h   d    3
    c   h    3
    h   e    4
    e   b    4
    m  b    6Can I make a query which gives the shortest path from vertex 'a' to vertext 'e' using Spatial?
    If this possible, that query gives the following result. (row-spanning form)
    I think this is almost impossible using just a hierachical query.
    Any method for this in Oracle Spatial?
    spath
    a
    k
    c
    b
    e
    This is not a sort of homework or exam, just my interest.
    Thx in advance.
    Query Your Dream & Future at
    http://www.soqool.com

    yes why not! in your case just create a logical network- called LRS Network and insert your vertices in node- table and additional information plus cost in the link table.
    you can find ways using by dijkstra and A*

  • Shortest Path Java Code

    Hi
    I have created a topological network in Oracle Spatial and now
    I am trying to find the shortest path between two nodes.
    Is there a sample java code (or instructions) that connects to the database
    and gets that information?
    Thank u

    Oracle Spatial NDM Java API has several shortest path analysis functions. A simple example is as follows.
    // establish JDBC connection: you need specify dbURL, user1, password1
    OracleDataSource ods1 = new OracleDataSource();
    ods1.setURL(dbURL);
         ods1.setUser(user1);
         ods1.setPassword(password1);
    Connection conn1 = ods1.getConnection();
    // read in network, netName is the name of your network in the database
    Network net = NetworkManager.readNetwork(conn1, netName);
    // perform shortestPath analysis
    Path path = NetworkManager.shortestPath(net, startNodeID, endNodeID);
    // then from Path interface, you can access its constituent link/node information
    }

  • Computing of the shortest path using a custom cost function in Oracle NDM

    Hi to all,
    I have Oracle 10g R2, I'm working on Oracle Network Data Model. I created a Network (named ITALIA_NET) based on links table (named ITALIA_LINK$) and nodes table (named ITALIA_NODE$).
    Until now I computed the shortest path between two nodes using the 10gR2 NDM Java API, in particular I used the shortestPath() method.
    I know that this method computes the shortest path between two nodes on the base of the values of a field that can be the lenght OR the travel time of the links.
    What I wish to do is compute the shortest path between two nodes with a function that considers ( at the same time ) more parameters and on the base of them returns a path. For example, I want compute the shortest path taking into account these parameters for the links:
    travel times of links
    gradient links
    tortuosity links
    Infact, I have for each link the costs of: travel time (for example 3 minuts for cross the link), gradient (for example, the link has 2% of gradient) and tortuosity (for example, the link has two curves of 60° of angle).
    Do you have any idea how I can implement this?
    Are there other ways for reach this objective?
    I hope I explained well my objective.
    Thank you very much to all in advance.

    _1) If I convert the values of the other cost columns into the values of the primary cost column (time is ok), what is the formulation for do this conversion?_
    The modeling part is the most difficult part. I am not sure if there is a universal conversion formula between two different costs.
    One recommendation is to use time as your primary cost.
    For any other secondary costs, collect some data (or from some published statistics) on how these costs affect the travel time (based on the actual speeds wrt to gradients and tortuosity).
    I am not an expert on this. Maybe asking questions like,
    Q. how will a road of gradient = 10 deg affect the speed, uphill and downhill compared to the speed limit?
    Once you have a good estimates on the speeds, you can compute the travel times as the distance/length of the link is known. The same applies to tortuosity,
    Q. how will roads with 30/60/90 deg angles affect the travel speeds compared to the speed limit?
    Assuming you are using something like the speed limit as you normal travel speed to compute your travel time.
    _2) After conversion, how can I combine these columns?_
    Say if you have done the conversion part in Step 1, you have 3 costs,
    cost1, cost2, and cost3
    You can create a view on the link table with the combined link cost as (cost1+cost2+cost4) or
    you can create a new column that sums up the costs you want and use it as the link cost.
    hope it helps!
    jack

  • NXT shortest track calculation

    Hello,
    I have a urgent question. 
    One of our teachers has given us the challenge to build an nxt robot that can collect and sort collored balls that are lying on a "playing ground" as shown in picture. (yellow dots are ball locations)
    We get the "location" of the collored balls 5 minutes before start of challenge. (We now the places but we dont know which collor will be at what place) so we thought about inserting that by higlighting buttons for one collor of balls and leaving them blank for the other collor balls.
    Now, we made VI 's for: turning left/right, stop/riding over a crosspoint (where 2 black lines cross) we can use the ultrasone and light sensors etc... We did lot's of tests with them
    But now the problems starts:
    We have to write a labview program that can calculate the shortest way to a specified ball (Our goal is to collect 3 balls of same collor at a time before returning to base) following the black lines.
    Then transmitting the calculated short track to the nxt true bluetooth. (Shortest way means as less turns obviously).
    But we dont have any clue how to program such thing... we only have verry verry basic knowledge of labview and time is really running out...
    If anybody has an idea how to make such program or if anybody can give us detailed information on how to program that or if want to be our hero and you can make that program for us...
    Please let us know, we are desperate.
    Many thanks,
    Vincent
    (sorry for English mistakes... I'am used to speak dutch )
    Attachments:
    STEL SITUATIE.png ‏23 KB

    Hello Vincent,
    I do not seem to be able to open your attachment.
    Is there an error that you're running into?
    What algorithm are you trying to implement to solve this problem?
    Do you need to write a program that calculates the shortest path or the shortest amount of time needed?
    Shortest path doesn't necessarily mean for me the least amount of turns.
    Did you already have a look at this page (http://nxtmastery.com/) to get started with the program?
    Have you already defined your algorithm in pseudo-code?
    This will help you with implementing your algorithm.
    Kind Regards,
    Thierry C - Applications Engineering Specialist Northern European Region - National Instruments
    CLD, CTA
    If someone helped you, let them know. Mark as solved and/or give a kudo.

  • Shortest path problem

    hello,
    We have a street-layer (spatial). Now we should calculate the shortest path between two nodes. Does Oracle assist in this? Has anybody some experiences with this problem?
    Any help will be appreciated.
    regards
    Anna

    Well, I know there are several algorithms for this problem, but I wanted to know, if and how Oracle assist�s in this point. I get an answer from Oracle, that 10g include such functionality and now I am waiting on it.
    Thanks for your try to help.
    Monika-Anna

  • Shortest Path Algorithm with Djikstra

    Hi all,
    im developing a shortest path searching techniques by using Djikstra's algorithm. My search space is very huge and it is about 100,000 nodes or we can call it Vertex. I store all the nodes and weight of edges in MySql as follows:
    From | To | PathCost
    A B 2
    B A 2
    A D 9
    D A 9
    B C 7
    C B 7
    B E 5
    E B 5
    C D 5
    D C 9
    Whenever the class receive any request from someone who want to go from point A to point Z, it will load the data from mysql by using "Select * FROM table WHERE From='Variable' ", and declare it as new Vertex, and perform the search. The reason i load it from MySql everytime i receive a new request is because any new node can be added to database anytime.
    In a nut shell, im developing a system to search for a shortest path in real world, i represent buildings as a Vertex, and road as edges, any idea of what can i improve my current djikstra searching method or any new developement to reduce the running time to lowest??
    regards,
    howsen

    minimal spanning tree != shortest path...
    Mr. Pike is indeed correct. Consider this simple example. arrange a bunch of dots around the rim of a circle. Consider the distance between them to be just the standard measure of distance in the plane. Assume that the points are fairly evenly spaced, but not exactly evenly spaced.
    The minimal spanning tree, which you got by first joining the two closest points and then the next two, and then by joining more points to that structure, will end up looking like a letter C going around the circle and leaving a gap between the two points that were the furthest apart on the circle.
    Every point connects to every other point, possibly by passing through other points and it is minimal because it left out the widest gap.
    On the other hand, the quickest way to get from one tip of the C to the other tip is to go straight from the one to the other, not to walk all the way around the circle following a path that goes through every single other point in the system.
    Reducing a graph to a minimal spanning tree, gets you a single subgraph of the original grpah that has the least total distance. That, unfortunately, has nothing to do with telling you the fastest way to get from point A to point B traveling along the original graph.
    hence minimal spanning tree != shortest path...

  • Cost Factor in Shortest Path

    Hi,
    I need a little help.
    I am performing routing on geodatic data (i.e., locations with Lat/Long).
    I think the AStar shortest path algorithms are finding the shortest path on the basis of distance betwwen two nodes.
    I am not quite sure whether they are taking care of the cost column in the link table.
    for eg., say A-B-C and A-D-C are two alternative routes from A to C .
    such that A-B-C is the shortest path on the basis of geodatic distance between the locations A an C.
    But may be the cost-wise A-D-C would have been a shorter path.
    So, which path will the algo return?
    Also I do not want to implement AStarCostFunction class and provide a distance function.
    Please help me out.
    Regards.

    Hi,
    Any/all cost-based analysis in the network data model is done using the cost column. If the cost column contains geodetic distances then that is what will be used.
    Hope this helps,
    Dan

  • Can someone explain shortest path switch over in Multicast?

    Can someone explain shortest path switch overin Multicast?

    Hi,
    Shortest path switchover is used in PIM Sparse mode.
    The concept of Sparse Mode is the multicast traffic should only be delivered when there are active receivers in the network. To accomplish this SM has explicit Join and Prune mechanism rather than Flood and Prune used by Dense mode.
    When the last hop router (where receiver is connected) receives an IGMP join message, it sends a PIM Join towards RP. This creates shared tree from the last hop router till RP along the routers.Thus a shared tree has been created from last hop router till RP.
    At the same time the above procedure was taking place, the first hop router (where source is connected) starts sending PIM Register messages to RP (when source starts sending multicast traffic). This register messages are unicast so that the intermediate routers will not aware of multicast traffic. When the RP receives Register messages from first hop rotuer, it does below checks after decapsulation:
    1. Are there any shared tree for the specific multicast group. If yes then send a SPT join towards first hop router so that the multicast traffic from source will be delivered to RP via native multicast rather than encapsualted packets. Also RP sends Register Stop message to inform first hop router to stop sending encapsulated multicast packets.
    2. When there are no active groups in RP (i.e RP has not received any PIM join for the multicast group from any last hop router), RP sends a Register Stop message.
    By this the traffic from source flows via SPT till RP. From RP it flows via shared tree till receiver. Everything is fine till now. But the drawback in SM is placement of RP and the load on it. Since RP is located in a central location chances are there that the multicast traffic from source takes a longer path to reach the receiver. This will result in increase in latency along with increase in RP load.
    So in those cases, it is desirable for the multicast traffic from source flows to receiver on optimal path. This is done by SPT switchover and this is done when the multicast group traffic crosses the SPT threshold configured. In Cisco the default SPT threshold is Zero kbps. So when the last hop router receives first multicast packet via shared tree, it does SPT switchover. This is done by sending a SPT Join towards the source thus bypassing the RP. Now the traffic from source prefers the most optimal path to reach the receiver.
    The same time, last hop router sends a PIM prune towards RP to inform it that it does not want multicast traffic over shared tree. This is done to avoid duplication of the multicast packets over SPT and shared tree.
    Few facts:
    1. Last hop router needs information about the source to send SPT Join and this can only happen when it receives few initial multicast packets via RP shared tree.
    2. If you do not want the last hop router to fall back to SPT switchover, then configure SPT threshold to infinity in last hop router.
    Sorry for the long post.
    HTH.
    thanks
    Arun
    Pls rate if it is helpful

Maybe you are looking for

  • Weblogic 8.1.6 and Oracle 9.2.0.8 - query performance

    Folks, We are upgrading WebLogic from 8.1.5 to 8.1.6 and Oracle from 9.2.0.6 to 9.2.0.8. We use the Oracle thin client driver for 9.2.0.8 to connect from the application to Oracle. When we use the following combination of the stack we see SQL query p

  • Is it possible to embed a window in another?

    I know I kind of asked this previously, but is it possible to instead of changing the window class, embed a window or object into a current window, using Cocoa-Applescript? In the example of my application below, I'd like to fill the big empty area i

  • Here Drive+ wont install on lumia 620

    Hi, I just recieved my new Nokia Lumia 620 On the menu I have the car icon. When I press it it gives me a new screen titled Nokia Drive. Then at the lower left corner I have a button go to store. When I press that I go to the store, I get the details

  • Will the Logitech Tablet Keyboard for Android 3.0+ work with the Playbook 2.0 OS?

    Thinking of buying the Logitech Tablet Keyboard for Android 3.0+ for my Playbook but before I do I want to make sure it'll work with my Playbook with the new 2.0.  Can anyone help?

  • Can you use NIC Teaming for Replica Traffic in a Hyper-V 2012 R2 Cluster

    We are in the process of setting up a two node 2012 R2 Hyper-V Cluster and will be using the Replica feature to make copies of some of the hosted VM's to an off-site, standalone Hyper-V server. We have planned to use two physical NIC's in an LBFO Tea