Shortest path which includes all subset

In graphs (V,E) with negative edge weights but with no negative cycles , X <V and s, t in V .I need an algorithm to decide if exist in the graph ,shortest path from s to t with which includes all the nodes from X

Unfortunately the problem you are trying to solve in NP-complete (it means that the best known algorithm for doing this is exponential in time with respect to size of X) so the best solution is to check every possibility. But if your graph has some special form there may be efficient solution for this problem. In general it's special case is finding [Hamiltonian path|http://en.wikipedia.org/wiki/Hamiltonian_path].

Similar Messages

  • Shortest path code

    hi
    if nyone cud give me the code for finding the shortest path between 2 points but in this case all the paths have equal weights i.e. the shortest path would be the involvement of minimum number of nodes between the start & the end node.
    Please am stuck up if anyone can provide me with the code.
    Thanks in advance

    Related to Dijkstra's shortest path algorithm if all edges have equal
    weight, just the heap management (priority queue) will be much simpler.
    If the graph to be traversed isn't too big, a simple linear array could do the
    job fine where entry i indexes paths of length i. Nothing much else is to
    be gained though: it stil will be a permanent graph labeling algoritm.
    kind regards,
    Jos

  • Using MS Visual Studio C++ 2008 Express, the "LoadLibrary" function doesn't recognize the NI-VISA DLL: "visa32.dll". I've included all the paths to the DLL. Is there a problem with this C++ compiler?

    I'm using MS Visual Studio C++ 2008 Express.  I've included all the paths to the DLL, "visa32.dll" but the LoadLibrary("visa32.dll") call returns the statement that can't convert character string to LPCSTR (pointer).  I ran the same code with the Portland Group compiler (which I no longer have) and there was not a problem accessing the DLL.  Is there some requirement for the C++ 2008 Express compiler that needs to be met?

    Hello jterry,
    If you compile as Unicode you need to pass Unicode strings to
    Win32 APIs which have LPTSTR or LPWSTR string.
    When you want to write code compilable for Unicode
    and Ansi just enclose all string constants in _T(). In your case:
    LoadLibrary(_T("visa32.dll"))
    You can look at this post on the microsoft discussion forums for more information.  Have a great day.
    O. Proulx
    National Instruments
    www.ni.com/support

  • How to configure Team explorer 2010 command-line tool in Mac x os. configure shell or system path to include the folder to which (TF client) unzipped archive available.

    How to configure Team explorer 2010 command-line tool in Mac x os.
    Hot to configure shell or system path to include the folder to which (TF client) unzipped archive available. I am new to Mac X OS. Please help.

    Dmitry,
    Thanks for the great writeup!
    I think I've got my universal instant client libraries built correctly.
    I too am using MacBook Pro but I'm getting stuck at building the 32 bit oci8.so
    First problem is my pecl download (ver 1.4.1) did not contain a "configure" file so ./configure failed.
    I used configure from /sw/....... to try to continue.
    Second problem. Using existing configure from /sw/.... I used an appropriate variation of your example command
    (./configure --with-oci8=instantclient,/usr/local/oracle/instantclient_10_2 && make).
    Things look like everything ran OK but The output does NOT include an oci8.so file
    So I guess my question is: Which "configure" should I be using? And if it is not the one on the system under /sw/...
    where would I get it since it doesn't come in the pecl download?

  • Can I use my fully owned CS2 on my iMac OX 10.9.5 as I paid over $1850.00 some 7 years ago for it and have been told by "Experts" that I can reinstall from my original software disks (which I have including all passwords etc required. Please assist as whe

    Can I use my fully owned CS2 on my iMac OX 10.9.5 as I paid over $1850.00 some 7 years ago for it and have been told by "Experts" that I can reinstall from my original software disks (which I have including all passwords etc required. Please assist as when my old iMac died I find I could not get my CS2 to work.  Very frustrating for some one my age who cannot afford a new InDesign.  Thomas Bain

    CS2 was created for the Power PC processor which your old iMac obviously was.
    Your new Mac with OSX 10.9.5 is an Intel Mac and no longer runs Power PC applications.
    For several years after the transition from Power PC to Intel Apple had provided an emulator called Rosetta that allowed Intel Macs to run Power PC applications.
    However, the last version of the Mac OS that had Rosetta was OSX 10.6.8 Snow Leopard.
    Even if you could find a copy of OSX 10.6.8 it would be highly unlikely that it would ever install on a newer Mac due to different firmware versions.
    Your only hope is to buy an older used Mac that can run OS 10.6.8 Snow Leopard or earlier.
    Sorry, but that ship has sailed.

  • I did an auto software update on my iMac, which included a restart. When the machine restarted it's stuck with an Apple logo and spinning wheel. I've tried all of the key strokes that are supposed to work, but nothing has. Any suggestions? Thanks!

    I did an auto software update on my iMac, which included a restart. When the machine restarted it's stuck with an Apple logo and spinning wheel. I've tried all of the key strokes that are supposed to work, but nothing has. Any suggestions?

    Gray screen could be any number of things, bad third party at boot kext file, a bad Apple one, a bad install/upgrade of OS X, drive corruption etc.
    Run through this list of fixes
    Step by Step to fix your Mac

  • Flex Gumbo - Library Path "Include all classes" includes ActionScript Files

    I've added an "Actionscript File", i.e. a File with no package/class that is included in an actionscript class.
    In FlexBuilder 3, since there was no option to include all classes, I could optionally choose actionscript files.
    So, Make Flashbuilder's "include all classes" option to not include Actionscript Files by default.

    I opened a bug on jira.
    http://bugs.adobe.com/jira/browse/FB-22228

  • Netbeans 551: Include all libs in project jar file. Possible?

    Is it possible to manually, or automaticly, include the /dist/lib directory into my "GonioLabt,jar" to make it more 'stand alone', file wise.
    Netbeans generates this dist/README.TXT
    ========================
    BUILD OUTPUT DESCRIPTION
    ========================
    When you build an Java application project that has a main class, the IDE
    automatically copies all of the JAR
    files on the projects classpath to your projects dist/lib folder. The IDE
    also adds each of the JAR files to the Class-Path element in the application
    JAR files manifest file (MANIFEST.MF).
    To run the project from the command line, go to the dist folder and
    type the following:
    java -jar "GonioLab.jar"
    To distribute this project, zip up the dist folder (including the lib folder)
    and distribute the ZIP file.
    Notes:
    * If two JAR files on the project classpath have the same name, only the first
    JAR file is copied to the lib folder.
    * If the classpath contains a folder of classes or resources, none of the
    classpath elements are copied to the dist folder.
    * If a library on the projects classpath also has a Class-Path element
    specified in the manifest,the content of the Class-Path element has to be on
    the projects runtime path.
    * To set a main class in a standard Java project, right-click the project node
    in the Projects window and choose Properties. Then click Run and enter the
    class name in the Main Class field. Alternatively, you can manually type the
    class name in the manifest Main-Class element.

    Yes it is possible. The same question has been
    killing me all day. Here is how I did it.
    (I'm on Mac OS 10.4, but this should work anywhere)
    Netbeans produces the following:
    dist/myJar.jar
    dist/lib/swing-layout-1.0.jar
    I would prefer to have only:
    dist/myJar.jar
    But, as you know, myJar.jar requires the class files
    stored in swing-layout-1.0.jar. I unpacked the jar
    files and examined the manifest files. Here is how to
    unpack and repack the jar files into a single jar
    file:
    First, I renamed myJar.jar to myJar.zip and let OS X
    unarchive the jar for me. I did the same for
    swing-layout-1.0.jar.
    I then dropped the MANIFEST.MF file from
    MyJar/META-INF/ into a new folder on my harddrive
    Then, I dropped the package (its a folder full of
    class files) from MyJar/ into the same new folder on
    my harddrive.
    At this point, the new folder contains:
    /newFolder/MANIFEST.MF
    /newFolder/myPackage/
    Then, I grabbed /dist/lib/swing-layout-1.0/org/ and
    dropped that into the new folder.
    We now have in the new folder:
    /newFolder/MANIFEST.MF
    /newFolder/myPackage/
    /newFolder/org/
    Almost done:
    Open the MANIFEST.MF file with a text editor. Mine
    looked like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.5.0_07-87 ("Apple Computer, Inc.")
    Main-Class: ohm.GUI
    Class-Path: lib/swing-layout-1.0.jar
    X-COMMENT: Main-Class will be added automatically by
    build
    I replaced the ENTIRE contents of the file with
    this:
    Manifest-Version: 1.0
    Main-Class: myPackage/Main
    Where 'myPackage' is the folder containing my class
    files, and 'Main' is the class containing the
    'main(String[] args) method.
    Save the file and we're ready to repack the archive.
    Open the command line (in OS X this is the Terminal)
    I assume the syntax is the same in windoze; Navigate
    to the new folder you created.
    In OSX: cd /newFolder
    in windoze: cd \newFolder
    Then use java's jar command:
    jar cmf MANIFEST.MF MyJar.jar *
    What this does:
    jar is the command. cmf are flags: the 'c' is for
    creating a new jar archive, the 'm' is to specify a
    premade manifest file, the 'f' tells jar to write the
    results to a file. MyJar.jar is the name you have
    chosen for the resulting .jar file. the '*' is a
    wildcard character that tells jar to put every file
    in the present working directory into the new .jar
    Thats it! This produced myJar.jar which worked fine
    by itself, as it included all the classes from
    swing-layout-1.0.jar. It would be a trivial matter to
    write a shell script to do all this for you, unless
    of course you use something silly like windows, in
    which case you'll have to write a batch file or use
    python or something. Good luck, I hope this saves
    others time, drop me a e-mail if this was at all
    confusing! [email protected]
    You should be aware that doing this may well violate the licensing terms for third-party libraries
    By the way, what's silly about using Windows? Are you saying you don't develop for Windows because it's "silly"?

  • [svn:fx-trunk] 12673: Integrating latest FXGUtils now that TLF 566 is in trunk ( which includes a fix for TLF 2497992).

    Revision: 12673
    Revision: 12673
    Author:   [email protected]
    Date:     2009-12-08 14:41:28 -0800 (Tue, 08 Dec 2009)
    Log Message:
    Integrating latest FXGUtils now that TLF 566 is in trunk (which includes a fix for TLF 2497992).
    Changelist: 646928
    Implementation-Title: FXG Compiler
    Implementation-Version: 1.414471
    BuildDate: 2009/12/04:03:06:24
    Notes:
    Made bitmap clipping implementation more efficient.
    Bug(s) Fixed:
    - #2491501 (Inconsistent word spacing results between MXMLC static and runtime compilation)
    - #2492932 (MXMLC gets null pointer exception on this FXG)
    - #2489341(FXG with a large BitmapImage results in a malformed SWF)
        - Added code to break down straight edges whose dx or dy exceeds 65535 twips into smaller segments.
    - #2495874 (many objects are missing in Opacity.fxg renders via MXMLC static compiler)
        - FXGUtils now ignores gradient entries of more than 15 gradient entries.
        - It logs warnings for such violations and continues processing.
    QE notes: Yes, please remove whiteSpaceCollapse="preserve" from static FXG mustella test cases or please regenerate bitmaps.
    Doc notes: N/A
    Localization: No, there are just resource strings removed in this changelist, no new strings.
    Bugs: N/A
    Reviewer: Sujata
    Tests run: Checkintests, mustella spark/core/fxg (25 failures all relating to tests that have whiteSpaceCollapse="preserve" but the reference bitmap do not expect this behavior and should be regenerated or tests modified).
    Is noteworthy for integration: Yes
    Modified Paths:
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/fxg/FXGException_en.properties
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/fxg/swf/FXG2SWFTranscoder.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/AbstractFXGNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/ContentPropertyNode.j ava
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/TextNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/fills/LinearGradientF illNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/fills/RadialGradientF illNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/filters/GradientBevel FilterNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/filters/GradientGlowF ilterNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/strokes/LinearGradien tStrokeNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/strokes/RadialGradien tStrokeNode.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/sax/FXGSAXScanner.java
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/swf/ShapeHelper.java
    Added Paths:
        flex/sdk/trunk/modules/fxgutils/src/java/com/adobe/internal/fxg/dom/PreserveWhiteSpaceNod e.java

  • 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

  • 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.

  • Workshop IDE Build does not include all files

    We have property files also which we want included as part of the build process
    but if we use the IDE build it does not include them. We have to therefore export
    the IDE build and customize it to include *.properties like this
    <zip basedir="${dest.path}" zipfile="${ejb.outputJar}" encoding="UTF8"> <!-- JARs
    filenames are encoded UTF8 -->
    <zipfileset dir="${project.local.directory}" includes="*.properties" />
    </zip>
    which causes a problem for us because the exported build file is specific to a
    user's local PC and cannot be used in a team environment.
    How can we have the IDE build include all the files within a project i.e. include
    properties files also.
    Thanks
    Mindy

    Hi Mindy,
    Why not in EJB?
    Yes there is no argument as to why property files cannot be copied over from EJB
    project.
    The reason is that Workshop has not implemented the feature with EJBProject. We
    have that feature only for Java projects and not for EJB project.
    Thanks a lot,
    Vimala
    "Mindy" <[email protected]> wrote:
    >
    You are saying the same thing again. My question is why not for EJB projects?
    I know we can create the files in Java project and read them with specific
    java
    files to read them but WHY NOT IN EJB IS THE QUESTION?
    "Carl" <[email protected]> wrote:
    Feature of the EJB Project:)
    "Mindy" <[email protected]> wrote in message
    news:4034c351$[email protected]..
    We have these property files in the EJB project, not Java project.Why
    should they
    not be copied if they are part of the EJB project?
    "Carl" <[email protected]> wrote:
    The properties file do get copied over if they are part of Java project.
    Hence, we have created utility classes in Java project that read
    the
    property file.
    For other project types, like EJB the property files didn't get copied...
    "Mindy" <[email protected]> wrote in message
    news:4033b944$[email protected]..
    We have property files also which we want included as part of the
    build
    process
    but if we use the IDE build it does not include them. We have to
    therefore
    export
    the IDE build and customize it to include *.properties like this
    <zip basedir="${dest.path}" zipfile="${ejb.outputJar}" encoding="UTF8"><!-- JARs
    filenames are encoded UTF8 -->
    <zipfileset dir="${project.local.directory}"includes="*.properties" />
    </zip>
    which causes a problem for us because the exported build file is
    specific
    to a
    user's local PC and cannot be used in a team environment.
    How can we have the IDE build include all the files within a projecti.e.
    include
    properties files also.
    Thanks
    Mindy

  • Is it possible to move my iTunes from the old laptop to the new one (including all the music files and playlists) without having to start all over again with a blank iTunes?

    Is it possible to move my iTunes from the old laptop to the new one (including all the music files and playlists) without having to start all over again with a blank iTunes?

    yes
    You will need to copy the whole iTunes folder which is in your user profile on the old computer in Music folder.
    Before you do it make sure iTunes are updates on the old computer and it works without any problems.
    This will copy all your media, music, movies (provided you did not change the default location).
    After the migration you will need to sing in to Apple store again with your Apple ID
    and also authorize your new computer (both done from the tom menu bar in Store.
    Once you are done please deauthorize your old computer (the same menu path) if you are not planning to use it anymore.
    Any problems post here.

  • How to create report which includes records of current month and last 7 days of previous month.

    Hi Experts,
    I need to create a report which includes records of current month and last 7 days of previous month.
    I will get records of current month by this formula :- month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)
    Please tell me how to add the records of last 7 days of previous Month for the same report.
    Thanks in Advance.

    Hi Ajay,
    If you have more than a year data in your database then your formula will return wrong results. ie. If your data consist of 2012,2013,2014 data then below formula will return all 8th month data irrespective of year. So, you need to check year also here
    month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate)
    Now add Abhilash second statement in OR so, your formula should look like :
    (month({PROBSUMMARYM1.OPEN_TIME})=month(currentdate)  and
    Year({PROBSUMMARYM1.OPEN_TIME})=Year(currentdate))
    OR
    Date({PROBSUMMARYM1.OPEN_TIME}) IN [DateAdd('d',-7,Maximum(LastFullMonth)), Maximum(LastFullMonth)
    -Sastry

Maybe you are looking for

  • Acura USB Connection Problems After iOS 8.2 Update

    I have a 2014 Acura MDX and prior to the iOS 8.2 update, I could play music either via Bluetooth or the USB connection through the iPod "source" (though the USV connection had far superior sound).  After the update, the USB connection doesn't work an

  • Error while updating, now it will not turn on.

    My friend has had this problem, it is not mine, but she asked me to look into it for her. She was having troubles with her iPod Touch, such as when she was looking through the album view, it would stop playing the song that was currently playing and

  • Anyone else having wifi drop out issues with their iPad 3?

    Right from the word 'go' I have experienced frequent losses in wifi connectivity on my iPad 3 (64Gb, 4G). Fortunately I don't have to keep re-entering my wifi password but I do have to keep renewing the lease which is really tedious.  My iPad 2 works

  • BBP_INB_DELIVERY_CREATE issue

    Hi, I have to split an inbound delivery into several different inbound deliveries depending on the lines in table xlips. For this I'm using function module  BBP_INB_DELIVERY_CREATE. When using this function module I get an error: No item category exi

  • Application support in N-8

    Can i install v5 & v3 application in N-8 ?