Graph Theory Algorithm-All possible paths between 2 vertices w/ constraints

Hi all,
I have a project I'm working with. I need to find all possible paths between two vertices on a graph.
I realize this will be NP-complete or worse, but right now i'm looking for a brute force method to do this via algorithm/pseudocode
Given:
connected, weighted edges, directed Graph G = (V,E) with no loops
Given v1 and v2 are vertices in V, and C = constraint value,
I would like a way to find all possible paths from v1 to v2 that have a length less than C. Length = adding up all the edges on a path
Can anyone provide any help on this?
Thanks!

Sure, no problemo.
Create a bucket of paths, initially empty. (Bucket is a technical term for a collection)
Start at v1. Take all the edges that lead from v1 to any place else, like x.
Each one of those paths consists of a single edge is a path from v1 to somewhere and furthermore it has a length. It is a partial path with a length Now do it again, grab any path out of the bucket, leave from its terminal point x and extend it by an edge and create a bunch more paths that are now two edges long, which you can throw back into that same bucket.
If you ever get to v2, you have a path from v1 to p2. Add it to your solutions list. If you ever exceed C, well throw it out because it is too long. And if you can't extend from a particular vertex then toss it as well.
All you ever do is pull a partial path from the bucket, create all its possible one edge extensions, keep the winners, toss out the impossible, and throw all new still valid partial paths back into the bucket.
If there are loops and if there are edges with zero or negative weight, this would not necessarily terminate. But you say that is not a problem for you.
Just for the record, nothing is worse than NP-complete.

Similar Messages

  • Finding all unique paths in graph

    can anyone suggest an algorithm to find all unique paths between two nodes?
    I have already implemented a variation of Dijkstra's shortest path algorithm to find ONE path, i'm just not sure how I can find ALL unique paths..
    Any help much appreciated.
    thanks :)

    I'm not really sure about the english terminology to be used and most of inteligent discussions ends up with finding the proper words for definitions :)
    Let me just say I wrote the algorhytm that found all 3 paths in the small example graph (I know, I know. Still testing. Besides I don't want to prove that the code is complete in mathemathical meaning). The limitations are like for every real life path finding algorhytms (let's go from a to b, 0 or more paths may exists, 2 nodes may have 0 or 1 connection, the connetions are not directed, i want unique paths, and I don't want circles in any of the paths).
    In the iteration
    - I check if the path is ends with ENDNODE
    - I get all the neighbors of the last node and generate all the possible paths extending the current (exceptions: path never can include the same node twice) and add them into a queue
    - I get the first from the queue and that is the current path now.
    The iteration ends when I have no more paths to analyze.
    If I undestood the term "unique path" as it can have any circles in it then I may agree with you, but thats another problem.
    In that case (if I had a school homework or I was working for a science group which has no access downloading these kind of algorhytms and they must come up with one for some reason :) I think I'd try to find all the unique circles first then all the paths (without the circles) and then combined them in all the way...
    I'll improve and test the algorhytm before publish it.

  • All Paths between 2 Nodes

    Hi ,
    Can someone please let me know how I could be achieving this?
    I want to find out all the paths between the Source Node A and the Destination Node B.
    I donot want the shortest path but all the paths between the 2 nodes.
    Also I donot have any weight/cost associated with any path. ( Graph is a directed graph)
    Regards,
    Akshatha

    Hi,
    Maybe this :Scott@my11g SQL>l
      1  with links(n1,n2) as (
      2  select 'A','B' from dual
      3  union all select 'A','C' from dual
      4  union all select 'B','C' from dual
      5  union all select 'B','D' from dual
      6  union all select 'D','G' from dual
      7  union all select 'C','G' from dual
      8  union all select 'D','I' from dual
      9  union all select 'C','E' from dual
    10  union all select 'E','F' from dual
    11  union all select 'F','G' from dual
    12  union all select 'F','H' from dual
    13  )
    14  select pth
    15  from (
    16  select connect_by_root(n1) || sys_connect_by_path(n2,'>') pth ,n2
    17  from links
    18  start with n1='A'
    19  connect by nocycle prior n2=n1
    20  )
    21* where n2='G'
    Scott@my11g SQL>/
    PTH
    A>B>C>E>F>G
    A>B>C>G
    A>B>D>G
    A>C>E>F>G
    A>C>G

  • Graph Theory question...

    My graph knowledge is still requiring maturing. ;) I was wondering if anyone could help me with this question:
    given a set of verticies in an undirected graph, (not all may be connected) I want to determine whether there exists a "walk" from Vi to Vj and if so, I want to work out the shortest "path" between the two.
    I can use a matrix to define my graph view no problems, but how to determine all this computationally is a bit challenging.
    Richie !

    shortest path, as in the "Traveling Sales Person" problem does not require all possible paths to be searched, but it does require setup as if all would be searched (British Museaum style of search using a depth first algorithm). Heuristic clipping of paths can be done once you have an inital path of length L. Any time you reach L length you need not follow that path, nor any of its children. If you reach the destination in shorter than L length, then take the new path as the optimal path length and continue until all paths are exhausted.

  • Finding Paths Between Two Nodes Using SQL Sorted by Cost

    Hi Gurus,
    I want to find all paths from source node to target node that shall be sorted by the cost. I don't know whether it could be achieved with SQL statement. How to start with this query? The script to create the underlying tables along with the data are given below:
    create table nodes ( nodeId int Primary Key, nodeName varchar(50));
    create table paths ( pathId int Primary Key, fromNodeId int, toNodeId int, cost int );
    insert into nodes values (1,'ISL');
    insert into nodes values (2,'LHR');
    insert into nodes values (3,'HYD');
    insert into nodes values (4,'FSL');
    insert into nodes values (5,'MUL');
    insert into nodes values (6,'KHI');
    insert into nodes values (7,'QT');
    insert into paths values (1,1,3,20);
    insert into paths values (2,1,5,10);
    insert into paths values (3,1,7,80);
    insert into paths values (4,2,4,10);
    insert into paths values (5,3,4,40);
    insert into paths values (6,3,5,20);
    insert into paths values (7,3,6,10);
    insert into paths values (8,6,7,30);
    insert into paths values (9,6,5,30);
    insert into paths values (10,6,3,10);
    insert into paths values (11,7,2,20);
    insert into paths values (12,5,4,40);
    insert into paths values (13,5,7,40);
    Suppose the source = ISL and target = QT, their are various paths from ISL to QT:
    Ord# Relative Path Cost
    ==== ================================= =================
    1. ISL -> MUL -> QT 50
    2. ISL -> HYD -> KHI -> QT 60
    3. ISL -> QT 80
    4. ISL -> HYD -> MUL -> QT 80
    5. ISL -> HYD to KHI -> MUL -> QT 100
    This gives us all possible paths sorted by cost.
    Any hint or help will be highly appreciated.
    Thanks in advance and best regards
    Bilal
    Edited by: naive2Oracle on Feb 11, 2011 9:59 AM

    I like recursive with clause B-)
    col path for a30
    with nodes(nodeId,nodeName) as(
    select 1,'ISL' from dual union
    select 2,'LHR' from dual union
    select 3,'HYD' from dual union
    select 4,'FSL' from dual union
    select 5,'MUL' from dual union
    select 6,'KHI' from dual union
    select 7,'QT'  from dual),
    paths(fromNodeId,toNodeId,cost) as(
    select 1,3,20 from dual union
    select 1,5,10 from dual union
    select 1,7,80 from dual union
    select 2,4,10 from dual union
    select 3,4,40 from dual union
    select 3,5,20 from dual union
    select 3,6,10 from dual union
    select 6,7,30 from dual union
    select 6,5,30 from dual union
    select 6,3,10 from dual union
    select 7,2,20 from dual union
    select 5,4,40 from dual union
    select 5,7,40 from dual),
    tmp(nodeName,fromNodeId,toNodeId,cost) as(
    select a.nodeName,b.fromNodeId,b.toNodeId,b.cost
      from nodes a,paths b
    where a.nodeId=b.fromNodeId),
    rec(nodeName,path,fromNodeId,toNodeId,cost) as(
    select nodeName,cast(nodeName as varchar2(40)),
    fromNodeId,toNodeId,cost
      from tmp
    where nodeName = 'ISL'
    union all
    select b.nodeName,a.path || '->' || b.nodeName,
    b.fromNodeId,b.toNodeId,
    a.cost+decode(b.nodeName,'QT',0,b.cost)
      from rec a,tmp b
    where a.toNodeId = b.fromNodeId
       and a.nodeName !='QT')
    CYCLE fromNodeId SET IsLoop TO 'Y' DEFAULT 'N'
    select path,cost from rec
    where IsLoop ='N'
      and nodeName ='QT'
    order by cost;
    PATH                    COST
    ISL->MUL->QT              50
    ISL->HYD->KHI->QT         60
    ISL->HYD->MUL->QT         80
    ISL->QT                   80
    ISL->HYD->KHI->MUL->QT   100

  • Network LOD support for All Paths between 2 nodes

    In the in-memory Network API, there is a method NetworkManager.allPaths. This method returns available paths between 2 nodes with possible constraints. I am looking for a similar method in the LOD NetworkAnalyst class and am not finding it. Is there something similar?
    Or, here is what I want to do, and maybe there is a better way to do it. I am using NDM to data-mine our roadway inventory. Its a big network, whole state of Ohio, all roads--both local and state. One of the things I am trying to identify are what we call co-located routes. These are routes that have multiple names, for example, the ohio turnpike is both Interstate 80 and 90 on the same bed of road. In our line work, where these routes are co-located, we would only have a record for 80. The portion of 90 that we would have would be only in the case where it is NOT co-located with 80; in other words, 90 has a gap where it is co-located with 80. This is true for all our roads. In this case, we call 80 the primary, and 90 the secondary. We can have infinite secondaries (our worst case scenario is 6 routes overlapping). My situation in many cases, is I know that a route becomes secondary, I know how long the secondary section is, but I don't know what the primary is, so I want to discover it.
    Given these assumptions, I should be able to ask for all paths between 2 nodes that exactly match a cost (the overall length of the overlap). This should be simple with NDM. I provide a begin node, an end node, and a target cost, possible some traversal constraints, and it returns me the candidate paths. I thought that NetworkAnalyst.withinCost would do this, but as I discovered from the Stored Procedure docs, it returns the shortest path within the given less than or equal to the given cost--not necessarily the path I am looking for.
    Any advice? FYI, I am using Oracle 11GR2.
    Thanks, Tom

    So what I have come up with so far, is that the NetworkAnalyst trace methods provide this type of functionality. For example, with traceOut, I provide a start node, distance and some traversal constraints, and it returns me all paths less than or equal to the specified distance. What was throwing me a little with this method was the application of the LODGoalNode. I was thinking that the goal node would allow me to specify a particular node to be a requirement for the entire path such that a resulting path would have my start node, and end on a particular goal node with links in between. That IS NOT how it works. The LODGoalNode.isGoal is tested for EACH link that is part of a potential path, and only if this method returns true, is it added to the resulting path list.
    In my case, if I specified a start node and implemented the LODGoalNode.isGoal method such that it tested the provided end node for equality to my target node, the result would be that only links containing that specific goal node in the link. Anyway, so in my implementation, I leave the goalNode of the traceOut method null.
    So I have a new question. Is there a way to test when a path has been found, and then apply some constraints on it (PathConstraint)? This would be useful in cases where you get many paths returned to you, but in addition to a maximum distance constraint, you also want to apply for example a minimum distance on the resulting path, or that this is only a valid path if it ends on a particular node. Maybe there is a way to do this, and I haven't figured it out yet. The old AnalysisInfo class used to have a way to query the current path links and nodes, that would be useful in the LODAnalysisInfo class to help accomplish this perhaps? This feature isn't critical, because I can filter the list of paths returned from traceOut on my own after they are returned, but it would add some efficiency, especially when a large amount of paths are returned.
    Thanks, Tom

  • Is it possible to synchronize all my data between my macbook and my imac

    Is it possible to synchronize all my data between my macbook and my imac automatically ? By icould or any thing esle ?

    Depends what OS each has, but Migration Assistant is one way.

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

  • Path between Imovie HD and IDVD

    When I press the "create IDVD project" in IMOVIE HD and expect my movie to be exported to IDVD I get nothing.
    Can any one tell me how to see if the path between the two programs is gone? I am using MAC Leopard 10.5.8,
    Imovie 5.0.2, IDVD 7.0.4. I have used  IDVD in the past but this movie is too large and I needed to break it up.
    I also, saved the file in the movies folder and then used the drag and drop into IDVD but what to with it, way too large for disc.
    I still need to know why I cannot use the documented procedure. Any ideas?

    Hi Jeep,
    welcome to the  board
    iMovie is a video edit app, meant to work with firewire connected miniDV camcorders.
    iDVD is an encoding, authoring and burning app to create videoDVD
    both apps are part of the iLife suite (plus iTunes, for music, iPhoto for photo, iWeb for website creation…), and are meant to work all together with a single click…
    all apps can do other tricks (e.g. importing content of non-copy protected videoDVDs, editing mpegs etc), but as said, they are not meant for/other apps are better to accomplish that.
    "ripping" DVDs is in my understanding to copy content from protected/commercial videoDVDs… that IS possible with a Mac, a few apps are on the market, the Rules of Common Behavior in this forum don't "allow" linking to such apps, because in most areas on this planet ownership, usage, even mentioning (! here in Germany…) such apps is illegal.
    ripping is NOT supported by iDVD
    to copy DVD can be done with every Mac included Disk Utility, to copy just parts you need 3rd party software. (a videoDVD is not meant for editing, it uses a delivery format… socalled "mpeg editing" is better supported on Windows… doesn't fullfill the high quality standards of Apple… )

  • Graph Drawing Algorithms II

    Hi guys,
    I'm researching graph layout algorithms. Most of the packages available don't suit because they require the user to specify a number of nodes and edges between them and then it draws them very prettily.
    Because I want an extension of a Circle class to be drawn and I need it to be drawn on a customised JPanel called Canvas most of these programs aren't suitable. I have the program laying them out itself but atm they look crude and horrible.
    What I'd like is a plug in java program that can assign coordinates and a basic structure to the graph that I entered.
    Thank you very much for reading this far,

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class CircleTest extends JPanel
        CircleModel[] circles;
        CircleModel selectedCircle;
        final int
            PAD  = 20,
            SIZE = 10;
        public CircleTest()
            Point[] cps = { new Point(25,25), new Point(80,60), new Point(35,80) };
            circles = new CircleModel[cps.length];
            circles[0] = new CircleModel(cps[0], 15, Color.green.darker(), Color.cyan);
            circles[1] = new CircleModel(cps[1], 20, Color.red,            Color.orange);
            circles[2] = new CircleModel(cps[2], 15, Color.blue,           Color.magenta);
        protected void paintComponent(Graphics g)
             super.paintComponent(g);
             Graphics2D g2 = (Graphics2D)g;
             g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                 RenderingHints.VALUE_ANTIALIAS_ON);
             double w = getWidth();
             double h = getHeight();
             double xInc = SIZE * (w - 2*PAD) / CircleModel.MAX_X;
             double yInc = SIZE * (h - 2*PAD) / CircleModel.MAX_Y;
             g2.setPaint(new Color(220,200,240));
             // vertical model grid lines
             double x = PAD;
             for(int j = 0; j <= SIZE; j++, x += xInc)
                 g2.draw(new Line2D.Double(x, PAD, x, h-PAD));
             // horizontal model grid lines
             double y = PAD;
             for(int j = 0; j <= SIZE; j++, y += yInc)
                 g2.draw(new Line2D.Double(PAD, y, w-PAD, y));
             double vw = w - 2*PAD;
             double vh = h - 2*PAD;
             for(int j = 0; j < circles.length; j++)
                 CircleModel circle = circles[j];
                 Color color = circle.color;
                 if(circle == selectedCircle)
                     color = circle.selectColor;
                 g2.setPaint(color);
                 Point2D p = circle.getLocation(vw, vh);
                 double[] s = circle.getSize(vw, vh);
                 g2.draw(new Ellipse2D.Double(PAD+p.getX(), PAD+p.getY(), s[0], s[1]));
                 g2.setPaint(Color.red);
                 p = circle.getCenter(vw, vh);
                 g2.fill(new Ellipse2D.Double(PAD+p.getX()-2, PAD+p.getY()-2, 4, 4));
        public void setSelection(CircleModel selected)
            selectedCircle = selected;
            repaint();
        public Rectangle2D getViewRect()
            Rectangle2D.Double r = new Rectangle2D.Double();
            r.x = PAD;
            r.y = PAD;
            r.width  = getWidth()  - 2*PAD;
            r.height = getHeight() - 2*PAD;
            return r;
        public static void main(String[] args)
            CircleTest test = new CircleTest();
            SweepTester sweeper = new SweepTester(test);
            test.addMouseMotionListener(sweeper);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class SweepTester extends MouseMotionAdapter
        CircleTest circleTest;
        CircleModel lastSelection;
        public SweepTester(CircleTest ct)
            circleTest = ct;
        public void mouseMoved(MouseEvent e)
            Point p = e.getPoint();
            boolean haveSelection = false;
            CircleModel[] circles = circleTest.circles;
            Rectangle2D r2 = circleTest.getViewRect();
            for(int j = 0; j < circles.length; j++)
                if(circles[j].contains(p, r2))
                    circleTest.setSelection(circles[j]);
                    lastSelection = circles[j];
                    haveSelection = true;
                    break;
            if(!haveSelection && lastSelection != null)
                lastSelection = null;
                circleTest.setSelection(null);
    class CircleModel
        Point2D center;
        double radius;
        Color color;
        Color selectColor;
        final static int
            MAX_X = 100,
            MAX_Y = 100;
        public CircleModel(Point p, int r, Color c, Color sc)
            center = p;
            radius = r;
            color = c;
            selectColor = sc;
        protected Point2D getLocation(double w, double h)
            Point2D.Double modelLoc = new Point2D.Double();
            modelLoc.x = center.getX() - radius;
            modelLoc.y = center.getY() - radius;
            Point2D viewLoc = modelToView(modelLoc, w, h);
            return viewLoc;
        protected Point2D getCenter(double w, double h)
            return modelToView(center, w, h);
        protected double[] getSize(double w, double h)
            Point2D cp = getCenter(w,h);
            Point2D loc = getLocation(w,h);
            double width  = 2 * (cp.getX() - loc.getX());
            double height = 2 * (cp.getY() - loc.getY());
            return new double[] { width, height };
        private Point2D modelToView(Point2D modelP, double viewWidth, double viewHeight)
            Point2D.Double viewP = new Point2D.Double();
            viewP.x = viewWidth  * modelP.getX() / MAX_X;
            viewP.y = viewHeight * modelP.getY() / MAX_Y;
            return viewP;
        public boolean contains(Point p, Rectangle2D r)
            Point2D loc = getLocation(r.getWidth(), r.getHeight());
            double[] size = getSize(r.getWidth(), r.getHeight());
            Ellipse2D e = new Ellipse2D.Double(r.getX() + loc.getX(),
                                               r.getY() + loc.getY(), size[0], size[1]);
            return e.contains(p);
    }

  • Possible path leak, unable to purge elements of base

    Our Labview 2012 SP 1 program runs to completion. However, when we close down the main panel after execution has finished, and it exits Labview, it crashes with an error report.
    I have attached one of the crash reports. Here's the text from one of the crash report files:
    #Date: 20 Mar 2014 18:26:45
    #OSName: Windows 7 Professional Service Pack 1
    #OSVers: 6.1
    #OSBuild: 7601
    #AppName: LabVIEW
    #Version: 12.0.1f5 32-bit
    #AppKind: FDS
    #AppModDate: 09/10/2013 09:10 GMT
    #LabVIEW Base Address: 0x00400000
    <DEBUG_OUTPUT>
    20/03/2014 18:41:30.868
    Crash 0x0: Crash caught by NIER
    File Unknown(0) : Crash 0x0: Crash caught by NIER
    minidump id: ef42f225-2da4-4a1a-8b0e-43f819a76f55
    ExceptionCode: 0xC0000005û¥l;uÐ
    </DEBUG_OUTPUT>
    Possible path leak, unable to purge elements of base #0
    Our program calls some of our own C++ libraries. They have been built into our software and running for well over a year without any trouble.
    A few weeks back, we changed all of our library call nodes from “Run in UI thread” to “Run in any thread”. I have tried changing them all back to “Run in UI thread”. It doesn’t make any difference.
    Any help with this problem will be greatly appreciated!
    Attachments:
    bf2a4406-18bc-4486-9e1a-93f6f06a5af5.zip ‏23 KB

    I cannot say that it is related to LVOOP, but I have seen this in every LVOOP project I have worked on.  The only way to know would be to write the exact same program as a non-LVOOP version.
    However, I recall seeing this message soon after starting a new project and after creating the initial classes.  I think I sent the small / new project to NI for investigation.
    So...  to answer your question....  it kinda looks that way..
    However, the executables have been solid.  I have not had complaints from the clients about unusual crash at the end of their run.  The software runs tests that can last a week (or more).  There are 3 or 4 different clients have code that use LVOOP. 
    The error is not something that I have been able to reproduce...  It just happens.. Mostly when closing the project.  Occasionally when running the code or trying to run the code.  I should pay more attention to the behavior. 

  • CS4 Select all compound paths?

    Hi all,
    There was a fab plug in set by Rick Johnson/Graffix called Select Menu. It is not yet updated for CS4.
    The only function from the set I truly need is the ability to select all compound paths. Just wondering if it is possible to do this with a script? I recently found a javascript to close all open paths, so that got me thinking there may be a way to select the compound paths with a script as well...
    The nice thing about scripts is they still seem to work even after a program upgrade. All my little applescripts are still working fine but my plugins are DOA in CS4. So I am thinking it would be great to have functions I depend on every day in script form.
    I also wondered if there is a way to call the script with a speakable items command, which I guess would mean creating an action to run the script that I could then assign to a function key...?
    So far I have not found a way to call a script in Illustrator using a speakable item.
    I have near zero scripting experience so apologies if this is an annoying stupid newbie question. I have RSI issues and need to do most of my work via voice commands... it can be challenging to figure out how to do these things since my expertise is in graphics, not programming.
    Thanks for any swift kicks in the right direction!!

    Hi,Thanks!!
    This does work but on a complex document it is very slow as it seems to be redrawing all the compound paths? It worked fine on a simple file but when I tried it on the kind of complex file I would actually use it on it has Illustrator hung up with a spinning beach ball....
    The Graphix plug in to select all compound paths worked instantaneously. Is there a different way to write this that would not be as processor intensive?
    Ah, the beachball just stopped spinning and all the correct paths are indeed selected...

  • Compiling all possible java files

    Hi,
    I have a project in which not all files/packages compiles but a set of packages compiles always.
    Say set of classes which might not compile as 'A' and set of classes which will always compile as 'B'
    On frequent basis i need to get update. And I am only concerned about set 'B' but when i compiles my project using ant
    compilation fails as 'A' compilation fails and because of that it doesn't go further to compile 'B'.
    So how to get eclipse like functionality to compile all possible files?
    what i have is
    ================================
    <javac debug="${debug}" deprecation="${deprication}"
                   optimize="${optimize}" destdir="${build.home}/WEB-INF/classes"
                   listfiles="${listfiles}" target="${jdk.compliance}"
                   verbose="${verbose}" srcdir="${src.home}"
                   memoryMaximumSize="512M" fork="true"
                   source="${src.compliance}">
                   <classpath refid="compile.path"/>
                   <include name="**/*.java"/>
                   <exclude name="HBM/**"/>
                   <compilerarg value="-Xlint:unchecked"/>
    ===================================
    I do not wish to write all the classes specifically that compiles in ant script.
    Thanks in Advance

    Try with failonerror option in your javac.
            <javac debug="${debug}" deprecation="${deprication}" optimize="${optimize}" destdir="${build.home}/WEB-INF/classes" listfiles="${listfiles}" target="${jdk.compliance}" verbose="${verbose}" srcdir="${src.home}" memoryMaximumSize="512M" fork="true" source="${src.compliance}" {color:#0000ff}*failonerror="false"*{color}>
                <classpath refid="compile.path" />
                <include name="*/.java" />
                <exclude name="HBM/**" />
                <compilerarg value="-Xlint:unchecked" />Regards,
    Prashanth.

  • Release all compound paths at the same time?

    Platform: PC/Windows XP SP2
    Adobe: Illustrator CS3 (13.0.2)
    Is it possible to release all compound paths in an illustration at the same time (and if so - how)?
    I receive drawings from engineering in either PDF or CGM format, which I edit in Illustrator and save as AI. I have to release compound paths in order to delete specific parts of the drawing.
    This isn't difficult, but it is very time-consuming because the CGM(or PDF)-to-Illustrator conversion results in quite a few compound paths.
    Thanks - I appreciate your help,
    Dan

    Are they all compound paths or are some of them compound shapes?
    Try release/expand compound shape?

  • Creating a tree of all possible combinations of {a,b,c,d}

    I am an MSc conversion student who is struggling with the initial stages of coding his Association Rule Mining dissertation project.
    I have a TreeNode class, which is in the process of being written.
    The class is designed to create a tree that stores all possible combinations of a Vector alphabet of strings {a,b,c,d}
    Please could somebody explain what my TreeNode class is doing so far?
    I have had a lot of help with this and I can't understand why there are so many vectors and what they all do.
    A few pointers (no sarcastic comments please) would be much appreciated.
    The code so far:
    package treenode;
    import java.io.*;
    import java.util.*;
    public class TreeNode
    public static final String INFO_TEXT ="A program to store a vector of string items a,b,c,d in all their possible combinations into a TreeNode class";
    private Vector alphabet;
    private Vector data; // this IS TreeRootData
    private Vector children;
    public TreeNode(Vector inputAlphabet, Vector inputData)
    // the alphabet and data have already been parsed in.
    this.alphabet = inputAlphabet;
    this.data = inputData;
    System.out.println("Tree node constructed with data "+displayVectorOfStrings(this.data));
    children = new Vector(); // we now construct the Vector of children
    //createChildren();
    public void createChildren()
    if data.length =
    // first check to see whether the current data length is the same
    // as the length of the alphabet
    // if it is then stop here (return;)
    // we loop through the alphabet we have...
    // for each candidate in the alphabet, attempt to create a new child TreeNode
    // with a data Vector that is the same as the data in this TreeNode plus
    // the candidate we are looking at in the alphabet. i.e. add available LHS
    // NB: Do NOT add if the candidate is already in the data. {a,b,a} is wrong!
    // NB: We will check to see whether data is already in the tree at a later stage
    // NB: The new Child TreeNode MUST BE ADDED to the children VECTOR -
    // or it will be lost
    public static String displayVectorOfStrings(Vector vector) //Printing the Vector of Strings
    String vectorText = "{";
    for (int i=0; i<vector.size(); i++)
    vectorText += (String)vector.elementAt(i)+",";
    if (vector.size() > 0) vectorText = vectorText.substring(0, vectorText.length()-1);
    // now we chop off the last element, replacing it with a closing bracket,
    // provided that the Vector is not empty.
    vectorText += "}";
    return vectorText;
    public static void main(String[] args) //main method WITH THE ARGUMENTS PASSED IN.
    // This main class can be thought of as OUTSIDE the TreeNode class. Although
    // it is in the file called TreeNode.java it is only here for convenience.
    // This is the top level of the program where everything starts. It is here -
    // that the alphabet is hardcoded in and that the Tree root is constructed.
    displayHeading();
    Vector alphabet = new Vector(); // constructing an initial alphabet,
    alphabet.addElement("a"); // which will eventually come from the database
    alphabet.addElement("b");
    alphabet.addElement("c");
    alphabet.addElement("d");
    System.out.println("Alphabet set to be "+TreeNode.displayVectorOfStrings(alphabet));
    // the root's initial data is now made into an empty Vector...
    Vector initialData = new Vector();
    // the root can now be constructed
    TreeNode treeRoot = new TreeNode(alphabet, initialData); // the treeRoot constructor
    public static void displayHeading()
    System.out.println();
    System.out.println(INFO_TEXT);

    I don't remember from which site I took this material.
    You read this to find all possible combination of a set {a,b,c,d}
    Consider three elements A, B, and C. It turns out that for n distinct elements there are n! permutations possible. For these three elements all of the possible permutations are listed below:
    ABC, ACB, BAC, BCA, CAB, CBA
    Since there are 3 elements there are 3! = 6 permutations possible.
    Suppose instead of A, B, and C you have a deck of 52 playing cards. There are 52! permutations possible (i.e., the number of different ways the cards could be shuffled). Since 52! = 8x10^67, you will need to play a lot of cards before you have seen every permutation of the deck! Since shuffling the deck is a random process (or it should be), each of these 52! permutations is equally likely to occur.
    Developing a non-recursive algorithm to generate all permutations of n elements is a non-trivial task. However, developing a recursive algorithm to do this requires only modest effort and this is what we will do next.
    1. Let E = {e1, e2, ..., en } denote the set of n elements whose permutations we are to generate.
    2. Let Ei be the set obtained by removing element i from E.
    3. Let perm(X) denoted the permutations of the elements in the set X.
    4. Let ei.perm(X) denote the permutation list obtained by prefixing each permutation in perm(X) with element ei.
    Consider the following example, which is provided to clarify the definitions given above:
    If E = {a, b, c}, then E1 = {b, c} since the element in position 1 has been removed from E to create E1. Perm(E1) = (bc, cb) since these are the only two possible permutations of the two elements which appear in E1. Finally, e1.perm(E1) = (abc, acb) which should be apparent from the value of e1 and perm(E1) since the element a is simply used as a prefix to each permutation in perm(E1).
    Given these definitions, we set the recursion base case when n = 1. Since only one permutation is possible for one element, perm(E) = (e) where e is the lone element in E. When n > 1, perm(E) is the list e1.perm(E1) followed by e2.perm(E2) followed by e3.perm(E3) � followed by en.perm(En). This recursive definition of perm(E) defines perm(E) in terms of n perm(X)s, each of which involves an X with n � 1 elements. Thus both the base component and the recursive component (of a recursive algorithm) have been established and we thus have a complete recursive technique to generate the permutations.
    The following Java method is an implementation of this recursive definition of perm(E). This method will output all permutations whose prefix is list[0:k-1] and whose suffixes are the permutations of list[k:m]. By invoking the method with Perm(list, 0, n-1) all n! permutations of list[0: n-1] will be produced. [This is because this invocation will set k = 0 and m = n � 1, so the prefix of the generated permutations is null and their suffixes are the permutations of list[0: n-1]. When k = m, there is only one suffix which is list[m] and list[0: m] defines a permutation that is to be produced. When k < m, the else clause is executed.
    In the algorithm, let E denote the elements in list[k: m] and let Ei be the set obtained by removing ei = list[i] from E. The first swapping sequence in the for-loop has the effect of setting list[k] = ei and list[k+1: m] = Ei. Therefore, next statement which is the call to perm computes ei.perm(Ei). The final swapping sequence restores list[k: m] to its state prior to the first swapping sequence (the state is was in before the recursive call occurred).
    public static void perm(Object [] list, int k, int m)
    {    //generate all permutations of list[k:m]
    int i; Object temp;
    if (k == m) //list has one permutation � so output it
    {      for (i = 0; i <= m; i++)
    System.out.print(list);
    System.out.println;
    else //list has more than one permutation � so generate them recursively
    for (i = k; i <= m; i++)
    {     temp = list[k]; //these next three lines are a simple swap function
    list[k] = list[i];
    list[i] = temp;
    perm(list, k+1, m); //the recursive call
    temp = list[k]; //reset the order in the list
    list[k] = list[i];
    list[i] = temp;
    }//end for-loop
    } //end method perm
    See the program pasted below that prints all possible combination of a set {a,b,c,d}
    public class Perm
    public Perm()
    public static void main(String[] args)
    String s = "abcd";
    char [] chars = s.toCharArray();
    perm(chars, 0);
    public static void perm(char [] list, final int k)
    int i;
    char temp;
    if (k == list.length-1) //list has one permutation, so output it
    for (i = 0; i <= list.length-1; i++)
    System.out.print(list[i]);
    System.out.println();
    else { //list has more than one permutation, so generate them recursively
    for (i = k; i <= list.length-1; i++)
    temp = list[k]; //these next three lines are a simple swap function
    list[k] = list[i];
    list[i] = temp;
    perm(list, k+1); //the recursive call
    temp = list[k]; //reset the order in the list
    list[k] = list[i];
    list[i] = temp;
    }//end for-loop

Maybe you are looking for

  • How to show rss from other sites on my site?

    how to show rss from other sites on my site? i'd like to have a window on my site that shows rss from another site (their content in a window on my site) thanks lenny

  • Eclipse newbie question

    I just installed eclipse with openjdk6. When I try to run something, even the most basic hello world thing, I get this: Exception in thread "main" java.lang.NoClassDefFoundError: Caused by: java.lang.ClassNotFoundException: at java.net.URLClassLoader

  • Break  column value using seperator ','

    In my table I am having column of type varchar2(1000). This column containing a text data(Contains text values seperated using ','). I want to display the values one by one in a report not as a single line. Table Col1 val1 , val2, val3,val4.. In repo

  • What are the components will come stardard ESS/MSS  BP implementation

    Hi Experts, I have to configure the ESS/MSS business packages in EP7.0 SP9 and backend system is ECC6.0. Can u please let me know what the functionalitys i can able to achieve by configuring the standard packages.. Can u please list out the all the f

  • Migration from 8.1.6 R2 to 8.1.7 R3

    What are the things which need a closer watch ! while migrating an application from 8.1.6 to 8.1.7. on SUN/Solaris Help will be appreciated. Regards Sunil