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.

Similar Messages

  • Graph scaling question

    Using the graph palette tools on a XY graph having 2 Y scale, I would like to scale the first Y axis without changing the second one. I use LV 6.0.2. Any tips? Thanks

    If you simply right click on the scale in question, you can format that. Just be sure to uncheck the Autoscale axis on the pulldown menu.
    eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • Graph Cursor Question

    I have a cursor on a XY-graph that I'm trying to adjust (x position) via controls on the front panel.  I have one control that works great and adjusts one number at a time (ex. 500 to 501, etc).  I'd like to have two controls one like I have that would be a fine adjustment (I believe) and another for coarse adjustment that would adjust the value by 50 or whatever.  Hence this would be adjusted first (ex 550) and then the other control would be adjusted for fine tuning (ex to say 551 etc). 
    I'm having trouble figuring this out, and was hoping someone could giv eme some tips or ideas as to what to do.  I thought this might be something fairly common, but maybe not.
    Thanks in advance...
    Using Labview 7.0 and 2010 SP1 with Windows XP and 7.

    LabVIEW 8.0 would make these things much easier, because we have events for cursor movements! .
    In LabVIEW 7.0, you need to code around it. For example, you could place the cursor reads into a timeout event which is only active when the mouse is down on the graph (enable timeout with mouse down, disable with mouse up event).
    The attached shows one simple possibility (I don't think you need the course control).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    DualCursorControl3.vi ‏64 KB

  • Ecommerce theory question...

    I've been working on my first online store, and just have a
    quick question that struck me whilst trying to think ahead, and how
    people could potentially break the system.
    I'm using web assist's ecart, and as it's my first, I'm not
    sure how things are typically set up.
    Basically this set up involves sending the customer to an
    externam payment gateway, where card details are taken and
    processed, before the customer is returned to the main site.
    At the point where the customer is sent on to the gateway, a
    record is created in an orders table, which includes a field 'Order
    Status', which defaults to 'Pending'. Once the payment has been
    approved, the customer is passed back to a 'return' page, which
    contains a script to update the order status field from 'pending'
    to 'accepted'.
    It also seems like a logical place to generate a receipt to
    be sent out to the customer.
    My question is this tho' - what's to stop a savvy customer
    getting to the payment gateway, but not entering any payment
    details, and then just manually going to the return page, which
    would trigger the update 'Order Status' field, and even worse,
    generate a receipt for something which hadn't actually been paid
    for?

    I suppose the session variables set by the success/failure of
    the
    transaction between the cart and the payment gateway would be
    the roadblock
    for this scheme. Surely the return page would check for that
    before
    triggering the update....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Iain71" <[email protected]> wrote in
    message
    news:[email protected]...
    > I've been working on my first online store, and just
    have a quick question
    > that
    > struck me whilst trying to think ahead, and how people
    could potentially
    > break
    > the system.
    >
    > I'm using web assist's ecart, and as it's my first, I'm
    not sure how
    > things
    > are typically set up.
    >
    > Basically this set up involves sending the customer to
    an externam payment
    > gateway, where card details are taken and processed,
    before the customer
    > is
    > returned to the main site.
    >
    > At the point where the customer is sent on to the
    gateway, a record is
    > created
    > in an orders table, which includes a field 'Order
    Status', which defaults
    > to
    > 'Pending'. Once the payment has been approved, the
    customer is passed back
    > to a
    > 'return' page, which contains a script to update the
    order status field
    > from
    > 'pending' to 'accepted'.
    >
    > It also seems like a logical place to generate a receipt
    to be sent out to
    > the
    > customer.
    >
    > My question is this tho' - what's to stop a savvy
    customer getting to the
    > payment gateway, but not entering any payment details,
    and then just
    > manually
    > going to the return page, which would trigger the update
    'Order Status'
    > field,
    > and even worse, generate a receipt for something which
    hadn't actually
    > been
    > paid for?
    >
    >
    >

  • Graph algorithm question

    Hello.
    I am trying to find a graph algorithm (by graph I mean nodes interconnected to each other,not the sketch of a function).This algorithm should yield the route that passes from as many nodes of the graph as possible,though it is forbidden to step on a node twice,and then ends back to the first node that it started from,thus forming a cycle.
    I am positive that this algorithm must have been researched by now,so in order to avoid thinking it myself I wonder if someone would know to direct me somewhere in the web where I can get it.Since I am a medical student,any terminology help would be also appreciated(as to the name of what I want,keywords to search etc).

    OK. Before you get too geeky here, try a brute force approach. if your graph is small or has limited connectivity, you may not need to get fancy. Its surprising what a computer can do without breaking a sweat. In any case I whipped up a solution as shown below. It is untested and will most likely have bugs (and does not check for null conditions). But as you can see the code is pretty basic and should get you from point A to point B (pun inteneded).     public List<Integer> getLargestCycle( Map<Integer,List<Integer>>graph )
            List<Integer> longestCycle = new Vector<Integer>();
            List<Integer> path = new Vector<Integer>();
            for ( Integer startingPoint : graph.keySet() )
                path.add(startingPoint);
                List<Integer> aCycle = getLargestCycle( graph, path );
                if ( aCycle.size() > longestCycle.size() )
                    longestCycle = aCycle;           
            return longestCycle;
        protected List<Integer> getLargestCycle( Map<Integer,List<Integer>>graph,
            List<Integer> currentPath )
            List<Integer> longestCycle = new Vector<Integer>();
            Integer currentPoint = currentPath.get( currentPath.size()-1 );
            Integer startingPoint = currentPath.get( 0 );
            for ( Integer nextPoint : graph.get( currentPoint ) )
                List<Integer> aPath = new Vector( currentPath );
                aPath.add( nextPoint );
                if ( nextPoint.equals( startingPoint ) )
                    if ( longestCycle.size() == 0 )
                        longestCycle = aPath;
                else if ( currentPath.contains( nextPoint ) )
                    // not a cycle here.
                else
                    List<Integer> aCycle = getLargestCycle( graph, aPath );
                    if ( aCycle.size() > longestCycle.size() )
                        longestCycle = aCycle;
            return longestCycle;
        }

  • Virtual Desktops theory questions

    Hello!
    Help me please clarify several questions on Windows Server 2012 R2 virtual remote desktop  infrastructure.
    Having read the following artcile http://windowsitpro.com/virtualization/virtual-desktop-infrastructure-part-2-finally-vdi
    "The Remote Desktop Connection Broker role service is really the brains of the VDI environment. It communicates with and controls the other components, working particularly closely with the Remote Desktop Session Host in redirection mode, which
    is why the Remote Desktop Connection Broker and Remote Desktop Session Host
    in redirection mode are frequently placed on the same OS instance. However, when you start having more than 250 simultaneous connections, you might need to consider breaking the roles onto separate servers.
    Remote Desktop Session Host in Redirection Mode
    The concept of using a Remote Desktop Session Host in redirection mode isn’t new.
    Remote Desktop Virtualization Host
    The Remote Desktop Virtualization Host role service is installed on any Hyper-V host that will be participating in a VDI pool. This role service lets the Remote Desktop Connection Broker
    role service communicate with the Hyper-V hosts, start and stop VMs, and gather internal information to enable client connections."
    ...I've concluded that RDSH and RDVH are the two separate roles that can be (and should be - according to the Figure1 !) installed onto the two separate OS instances (RDCB + RDSH in Redirection mode on one server and the RDVH on the other).
    But when it comes to deploying VDI in practice I don't see how it's possible to separate RDSH in Redirection mode and RDVH services. Moreover, if we look at the following  screenshots...
    http://blogs.technet.com/b/canitpro/archive/2013/04/25/step-by-step-deploying-virtual-desktops-with-windows-server-2012.aspx
    ...we'll see that on step 1 Add the Roles and features wizard "wants" to deploy the
    RDSH service while on step 3 the RDSH service transforms to the
    RDHV service.
    Q1) What does this service transformation means?
    Q2) Is it possible to have RDSH in Redirection mode and
    RDVH services on separate servers in Win2012?
    Q3) Is it possible when using pooled virtual desktop collection to set, for example, 2 cores per virtual desktops wich based on Template1 and 1 core per virtual desktops based on Template2?
    Thank you in advance,
    Michael

    "With RDSH, you will get RemoteApp, the "terminal sessions". Have you been around during Windows
    Server 2003 Tarminal Server? That´s it, but with additional RDWeb. RDSH is pretty much the same as Citrix XenApp overall." -
    yes, I understand.
    "You can setup VDI infra with only one server, you will need
    RDVH, RDWeb and RDConnector roles, that´s all. You don´t need RDSH role for running VDI.  -
    I'm agree... but if I have VDI up and running without RDSH why its item is present on Deployment Overview diagram???  Can't find corresponding documentation anywhere... :(
    Regards,
    Michael

  • Theory Question on reusing an object

    Hi,
    I am building a test question program. I have an object called TestQuestion that I would like to reuse by changing the text of the labels for every different question.
    I know that I can send arguments when I call or instantiate this object in my Interface class. But is there another way? What I mean is there a way to have all of the text for the questions located in separate methods within the TestQuestion class and then have the Interface send one command to pick and choose what question?
    public class Interface extends JFrame {     // 300
         static JPanel frameForCardPane;
         static CardLayout cardPane;
         private static JTextArea msgout;
         Interface () {     // 100
              super("This is a JFrame");
            setSize(800, 400);  // width, height
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              TestQuestionOne cardOne = new TestQuestionOne(msgout);
    public class TestQuestion extends JPanel {
        JLabel answerTextA;
        void buildConstraints(GridBagConstraints gbc, int gx, int gy,
            int gw, int gh, int wx, int wy) {
            gbc.gridx = gx;
            gbc.gridy = gy;
            gbc.gridwidth = gw;
            gbc.gridheight = gh;
            gbc.weightx = wx;
            gbc.weighty = wy;
        public TestQuestion(JTextArea msgout) {
          // set up layout
          GridBagLayout gridBag = new GridBagLayout();
          GridBagConstraints constraints = new GridBagConstraints();
          setLayout(gridBag);
           // answer A
          buildConstraints(constraints, 1, 0, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          answerTextA = new JLabel("This is where I want to change the text!");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
           gridBag.setConstraints(answerTextA, constraints);
          add(answerTextA);
          // answer B
          buildConstraints(constraints, 1, 1, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          JButton answerTextB = new JButton("Answer B");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerTextB, constraints);
          add(answerTextB);
          // answer C
          buildConstraints(constraints, 1, 2, 1, 1, 30, 5); // gx, gy, gw, gh, weightx, weighty
          JButton answerTextC = new JButton("Answer C");
           constraints.fill = GridBagConstraints.NONE;
           constraints.anchor = GridBagConstraints.WEST;
          gridBag.setConstraints(answerTextC, constraints);
          add(answerTextC);
          setVisible(true);
    }

    Mixing the data question data in with the question display class would generally be poor design.
    It would mean that anytime anyone wanted to add another question they would have to have access to the source code of your TestQuestion class and would need to recompile it.
    I'd also suggest that passing in a whole JTextArea just to describe the question text is overkill. Wouldn't a String do just as well?

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

  • Graphs/charts question

    Is there a way to make the classic graph or chart completely one colour, i.e. remove any embossed effects? If possible i would like to have been able to remove or paint black the lines shown in my attached png.  I’ve tried painting them but cant get them to vanish!
    Many thanks
    Attachments:
    Untitled.png ‏24 KB

    Here is a good resource, look at the video on recoloring graphs:
    http://https://decibel.ni.com/content/groups/ui/blog/2010/04/29/creating-quality-uis-with-ni-labview...
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • Main function theory question

    Hello,
    Java is said to be pure object oriented.
    In order to make an executable program, one must provide a main function in the class of execution.
    This behavior is not pure object oriented.
    why couldnt a program start running by executing the constractor of the main class?
    if you think this question is posted in the wrong forum, plz notify me where should i post it.

    The main method also exists for practical reasons. How else would the JVM pass command-line parameters to your program? Either you require that a class has a static main, or you require that it has a constructor that accepts an array of Strings. But what if your class requires a constructor with an array of Strings as it's only parameter? How does Java know that this isn't an entry point to the program? The static main therefore acts as a clear entry point, whereas constructors do not.
    I've never used Eiffel, but I have a tough time imagining how you could start a program from anything but a static context. Even if you started from a Constructor, it just means that the RT is creating a static context for you under the hood from which it is calling your constructor. This way, you at least have control over the context you are using.

  • Cheapest Routing using graph theory

    i'm really stuck on this. someone please help me out. The purpose is to determine the cheapest and most economical strategy to fly from the starting city to each of the other given cities.
    The program's outline/requirements can be found at:
    http://optlab.mcmaster.ca/~zhanghu/project_2.pdf
    All template files can be found at:
    http://optlab.mcmaster.ca/~zhanghu/Codes_Project_2.zip
    There is basically only 2 algorithms that need to be coded. The pseudocode for each algorithm is given in the project outline.
    PLEASE PLEASE PLEASEEeeeeeeeee help me with this. It's due tomorrow and I'm totally lost on this.
    I am willing to pay $50 if anyone can complete this for me.

    i got most of it working but i'm stuck on this
    specific part of the algorithm:
    public static int[ ][ ] MinPath(Graph L, int m)
    int j=L.n_vertex, k=L.n_edge,w[ ][],d[ ],p[ ];
    for(int i=0; i < L.getVertex(); i++)
    d[ ] = Integer.MAX_VALUE;
    p[i] = 0;
    }I know there is some error here but dunno exactly
    what or where.I think you stole this code... in fact I am pretty sure of it.
    That's okay because it doesn't make any sense either.
    Problems include
      &bull; Missing return
      &bull; d[ ] does not compile
      &bull; Doesn't do anything. Somehow if I was looking for the longest or shortest something I think an if statement fits in there somewhere
      &bull; No context in terms of what Graph is (though I suspect something not all that useful to you)
    I think you should just accept your failing mark. This code appears to have something to do with Graphics that you lifted from somewhere and you are trying to fool us into writing your assignment for you. Sorry but that turkey won't fly.
    Either try and learn and figure it our yourself or fail. Please stop trying to cheat like this.

  • 10g graph MarkerText question

    I use a bar graph and display marker text above each bar. My problem is when the # shown above the bar is 3 or more digits the number runs into the other bars beside it and makes it tough to read. I want to be able to display the text above the bars vertically if at all possible. I tried the following:
    <MarkerText visible="true" markerTextAngleDefault="90"/>
    But that didn't change how the text is shown at all. Can anybody help me?
    Here's my full xml for the graph:
    <rw:graph id="CT_5" src="G_REGION" groups="REGION" dataValues="CS_REGION_WITH,CS_REGION_WITHOUT,CS_region_date_range">
    <?xml version="1.0" ?>
    <Graph version="3.2.0.22">
    <LegendArea automaticPlacement="AP_NEVER" position="LAP_BOTTOM" borderTransparent="true"/>
    <LegendText>
    <GraphFont size="16"/>
    </LegendText>
    <MarkerText visible="true" markerTextAngleDefault="90"/>
    <O1TickLabel>
    <GraphFont size="14"/>
    </O1TickLabel>
    <O1Title text="Region" visible="true">
    <GraphFont size="16"/>
    </O1Title>
    <Y1TickLabel>
    <GraphFont size="14"/>
    </Y1TickLabel>
    <Y1Title text="Number of Facilities" visible="true">
    <GraphFont size="16"/>
    </Y1Title>
    </Graph>
    </rw:graph>

    Ok, I just figured out you have to set markerTextPlace="MTP_CUSTOM" in <MarkerText> but even then I can't get the text to be displayed vertically. Please help.

  • Theory question

    I have a doubt on this question:-
    purchase order for 25 pcs at 4 Rs / pc. tax = 5%. cash discount = 10 %. What will be the accounting document during invoice verification?
    a Input tax will be 4.5+ in net Posting
    b Stock account will be 10- in Gross posting
    c Stock account will be 10- in Net posting
    d Non operating result account will be 10- in Gross posting.
    my answer is 'd',because discount is posted as Non operating result
    will the gurus correct me
    thank you

    This may help:
    Programmatically Constraining a List In a Popup 
    At least it will demonstrate how LightSwitch works in regards to creating and consuming a query.
    Unleash the Power - Get the LightSwitch 2013 HTML Client / SharePoint 2013 book
    http://LightSwitchHelpWebsite.com

  • VMM theory question

    Hello!
    Please excuse me if this forum is not the appropriate one for my question but I failed to find a VMM specific forum here...
    "Building a Virtualized Network Solution" ebook, page 21:
    "When a logical switch is applied to a network adapter in a Hyper-V host, VMM uses the information contained in the logical switch and the selected uplink port profile to create a Hyper-V virtual switch on the host and..."
    Usually any Hyper-V host already has at least one virtual switch after the installation of the Hyper-V role. Does it mean that VMM would create the second virtual switch for the same host?
    Thank you in advance,
    Michael

    Hi,
    >Usually any Hyper-V host already has at least one virtual switch after the installation of the Hyper-V role.
    That's wrong. If you installed the role and didn't configured anything after that - you have no vSwitches. IF you nave any vSwitch bound to the NIC you plan to use for a Logical Switch - you'll have to delete a switch first.
    http://OpsMgr.ru/

  • VMM theory question 2

    Hello!
    One more question regarding VMM ("Building a Virtualized Network Solution" ebook (http://blogs.technet.com/b/scvmm/archive/2014/02/19/free-ebook-microsoft-system-center-building-a-virtualized-network-solution.aspx) :
    Q: What's the purpose of enabling SR-IOV for a switch if "When a Hyper-V virtual NIC is enabled for SR-IOV it is no longer connected to the virtual switch."?
    Thank you in advance,
    Michael

    To add to Alexey's statement - what you underlined in read is technically not correct.  It is a gross over-generalization of what is actually happening.
    There is always a virtual switch.  And that virtual switch must be enabled for SR-IOV thus validating that the physical NIC supports it.
    Now, when you get into packet flow, the Virtual Switch is actually still involved but very little - as it is the 'virtual network function' within the physical NIC that is handling most of the processing instead of the processor thread of the virtual switch
    - but it is still involved - there are still rules that can be set on that virtual port that the virtual switch may have to apply.
    And, as the failback - if the VM is live migrated the SR-IOV fails back to a regular vNIC until the Live Migration is complete.  And only goes back to being SR-IOV if the destination also supports it.
    And, John Howards blog talks about Hyper-V Manager, not SCVMM (which is where you are posting).  So be aware that SCVMM has its own rule set that it imposes beyond what you may be able to do with Hyper-V alone.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

Maybe you are looking for

  • How do I change my devices name?

    how do i change the name of my mackbook pro? i have an early 2011 13" model if that helps...

  • Can I use this - Horizon MiniPak Portable Fuel Cell Charger - to charge my iPad or will my warrantee be voided?

    Can I use an Horizon MINIPAK Fuel Cell Charger to charge my iPad or will that make my warrantee void?

  • TestStand Deployment Engine Serial Number

    Is there a way to get the Serial Number/License of a TestStand Deployment Engine that is installed on a PC? The NI License Manager does not report the Serial Number of the Deployment Engine. I have even tried to search the Window Registry. We have ov

  • Distributed Database  with IPV6

    Distributed database was not that familiar few years before...will IPv6 enhance the distributed database systems ? DDBMS has wide range of best features & notable drawbacks to..however today's business need of distributed database. contribution of DD

  • Ipod is not working

    When i came home from school i set my ipod on my kitchen table as usual and i guess it got a little moister or somthing i dont know but now it only works if i have it plugged into my computer please help ipod nano (2nd generation)