Help needed in a shortest path search problem..

Basically the problem is that there is a network of nodes with different paths to other nodes and I am supposed to find a shortest path from a random node to another random node.There are other criteria like weight, capacity etc. but that shouldnt affect the search algorithm... What is the best way to do this type of problem? Example would be great,thanks!

what about Breadth first search? Also for Dijkstra's, it seems to be dependent only on the weight of paths but if the paths have same weight, how do i go back to the previous node if a path wasn't found?

Similar Messages

  • Help NEEDED! External Hard Disk Drive Problem!

    Dear Forum,
    I am using MacBook with snow leopard and I am also using a WD Ext.HDD 500GB. Ok, I will described in detailed regarding what problem has occurred so that you guys can help me:D. Firstly, I formatted my wd hdd to hfs+j as the default format is NTFS. Then afterwards, I forgotten that hfs+j cannot support windows, thus I partition it to 2, with one hfs+j and one Fat32(formatted to ntfs when in windows), then I realised that my macbook don't have enough space, thus, I reformatted the whole hdd to one partition only, hfs+j. Now, the problem comes, when I formatted it to hfs+j, I found the free space not right, at default, the wd is 499.41GB(as seen on disk utility), but when I look at the hfs+j partition, the free space is only 499.06GB(as seen on disk utility with no files in it). Another thing, when I looked into the disk utility info of my hfs+j partition, there is 400+MB of hard disk space already taken. Then, I transferred one of my files(4.82GB) into my ext.hard disk, when the transfer is complete, I 'get info' my ext.hdd and found out that 5.26GB are taken up, but I have only transferred 4.82GB of files. So what is happening to my hard disk? Any ways to fix this problem guys?
    I really need your help! I will appreciate greatly if you guys can help me, thanks!:D
    Regards
    Ala.

    The odd 400MB is the hidden files put there by the system to define the file structure of the partition, plus other stuff like .Trash. It's perfectly normal and the HDD wouldn't be recognised if they weren't there.
    You will see a similar situation with the internal boot drive if you compare the Drive size (leftmost item with the manufacturers designation) and that of Macintosh HD (which is the working partition). In my case this shows 640.14 GB for the drive, 639.79 GB for Macintosh HD, a difference of 350MB
    This will be the same within about ± 50MB whatever drive you format in HFS+J, including pen drives.

  • Help needed with 915G Neo2 Platinum 2 problems please help doing my head in

    System
    Case Sonata II 450 watt, MSI 915G Neo2 Platinum, P4 3.4 650 LGA775, 2x512 ddr2 5300 (cruical) Maxtor 200gig sata hd, Sapphire x800, NEC 3540, Sony DVD rom & floppy. My machine runs very stable, 1st problem however on start up I get 3 bleeps can anyone tell me what this means. I have tried looking in the manual but cannot find any reference. The usb dongle that came with the mb is installed & the are 4 green lights on. 2nd problem if I try to load the digi cell software this causes the pc to freeze were I have to switch off at the wall. Thank you for the help.
    I have now installed a new mb & I am still getting the 3 beeps. I have ran memtest & the ram passed does anyone have any other idea's.
    Thank you for the help.
     Report to moderator    84.92.165.224 

    please help, i am going to throw myself out of the window.     

  • Help needed with HTC One regarding mic problem with noise cancellation

    I picked up an HTC One last week, and so far I am loving the phone.  Great build quality, screen, sound - all as advertised.
    However, there is one very annoying problem I am having.  When I am talking to someone, I can gear them great, but they keep telling me I sound muffled or robotic.  I performed some tests, and the problem appears to be something with the dual microphones and the HTC One's noise cancellation features.
    Here are the tests I ran:
    Typical phone call, with holding the phone as I normally do on the sides and to my ear.  Call result, pretty muffled voice.  I'd give the call quality a 5/10.
    Help the phone as I typically do, but covered the mic hole on the back of the phone.  This definatelyimproved call quality.  Was louder and clearer, but not perfect.  I'd rate it at 8/10.
    Help the phone towards the bottom, using my hand to kind of cup the bottom directing the sound to the bottom mic.  This was a further improvement in sound quality.  Rating would be 9/10.
    Help phone as normal, but covered the bottom mic hole.  Very low volume and muffled sound.  Rating a 4/10.
    Talked directly into the bottom of the phone into the bottom mic.  This gave perfect call quality and volume.  Rating a 10/10!
    Talked directly into the mic on the back of the phone. Horrible quality, couldn't hear hardly anything. Rating 0/10.
    Speaker phone on, held the phone up and moved it around as I would normally use a speaker phone.  Call quality was really nice.  Id give it 9/10.
    Speaker phone on, covered back mic hole and used speaker phone as in #7.  Very bad quality, rating 1/10 for call quality.
    Speaker phone on, covered bottom mic and help speaker phone in hand.  Really good quality, even an improvement over test #7.  Would give the call quality a 9.5/10.
    Speaker phone on, placed face down on table.  Volume a bit low, a little muffled.  Call quality 6/10.
    Speaker phone on, place face up on table.  A bit worse than test #10, low volume and a bit muffled.  Call quality is 5/10.
    Based on these tests, I know this problem has nothing to do with the network CDMA connection.  It is obvious that the noise cancellation features are a bit too aggressive, or I have some hardware problem with one or both mics.
    I question wether its really a hardware mic problem, because on non-speaker phone calls, talking directly into the bottom mic gives great quality.  And on Speaker phone, covering the bottom mic makes the speaker phone sound really good.  That's why I think there's something going on with the "Sense Sound" noise cancellation.
    Is anyone else seeing the same issues?  I want to be able to hold the phone normal on a non speaker phone call and get good quality.
    Looking for any tips and advice anyone can give.  Is it worth exchanging for a new one, as I am still in my 14 day window.
    Thanks in advance for the help!

    Here are some other threads that seem to be having similar issues:
    http://forum.xda-developers.com/showthread.php?t=2262648
    http://forum.xda-developers.com/showthread.php?t=2294532

  • Help Needed.. Creating custom calendar problems

    I am trying to create a calendar like this
    DateRun Shift
    10/27/2004 06:30 A
    10/27/2004 18:30 B
    10/28/2004 06:30 C
    10/28/2004 18:30 D
    and so on.. except that there is a small login inside for day when it is Thursday. One week Shift 'A' works and the next week Shift 'B' works..
    Here is the procedure; Appreciate your help immediately.,..
    CREATE OR REPLACE procedure create_calendar as
    STARTDATE VARCHAR2(20);
    shifter1 varchar2(5);
    shifter2 varchar2(5);
    shiftcycle number;
    counts number;
    begin
    startdate := '11/09/2000';
    counts:= 0;
    shiftcycle:= 14;
    delete from calendar;
    commit;
    for counts in 0..1000
    loop
    dbms_output.put_line(counts);
    if to_char(sysdate + counts,'DAY') = 'MONDAY' or to_char(sysdate + counts,'DAY') = 'TUESDAY' or to_char(sysdate + counts,'DAY') = 'WEDNESDAY'
    then
    dbms_output.put_line('Code in here 1');
    shifter1:= 'A';
    shifter2:= 'B';
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 06:30',shifter1 from dual;
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 18:30',shifter2 from dual;
    elsif to_char(sysdate + counts,'DAY') = 'THURSDAY' and mod((to_char(sysdate + counts,'mm/dd/yyyy') - startdate),shiftcycle) = 0
    then
    dbms_output.put_line('Code in here 2');
    shifter1:= 'A';
    shifter2:= 'B';
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 06:30',shifter1 from dual;
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 18:30',shifter2 from dual;
    elsif to_char(sysdate + counts,'DAY') = 'THURSDAY' and mod((to_char(sysdate + counts,'mm/dd/yyyy') - startdate),shiftcycle) <> 0
    then
    dbms_output.put_line('Code in here 3');
    shifter1:= 'C';
    shifter2:= 'D';
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 06:30',shifter1 from dual;
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 18:30',shifter2 from dual;
    elsif to_char(sysdate + counts,'DAY') = 'FRIDAY' or to_char(sysdate + counts,'DAY') = 'SATURDAY' or to_char(sysdate + counts,'DAY') = 'SUNDAY'
    then
    dbms_output.put_line('Code in here 4');
    shifter1:= 'C';
    shifter2:= 'D';
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 06:30',shifter1 from dual;
    insert into calendar (daterun, shift) select to_char(sysdate + counts,'mm/dd/yyyy') || ' 18:30',shifter2 from dual;
    end if;
    --exit when counts >1000;
    end loop;
    commit;
    end create_calendar;

    You don't say what your problem is, so it is kind of difficult to help.
    As a guess, I would say that your code only inserts rows for Wednesdays. TO_CHAR(date, 'DAY') returns a string padded with spaces to the length of the longest day name, in English, that is Wednesday (9 characters).
    SQL>DECLARE
      2     x DATE := sysdate;
      3  BEGIN
      4     IF TO_CHAR(x, 'DAY') = 'THURSDAY' THEN
      5        DBMS_OUTPUT.Put_Line('Is Thursday');
      6     ELSE
      7        DBMS_OUTPUT.Put_Line('Is Not');
      8     END IF;
      9
    10     IF TO_CHAR(x, 'DAY') = 'THURSDAY ' THEN
    11        DBMS_OUTPUT.Put_Line('Now it is Thursday');
    12     ELSE
    13        DBMS_OUTPUT.Put_Line('No it is not!');
    14     END IF;
    15  END;
    16  /
    Is Not
    Now it is ThursdayTTFN
    John

  • Help needed, stuck in a DnD JList problem

    Hi guys
    I got this code from internet and I was really expecting it would work, but it is not really transferring my Object to the other JList.
    I someone can help me I would appreciate that very much, below is the code, to the Model and to the Transfer.
    Model
    public class TabVernizListModel extends AbstractListModel {
        ArrayList<TabelaVerniz> lista;
        public TabVernizListModel(ArrayList<TabelaVerniz> lista) {
            this.lista = lista;
        public TabVernizListModel() {
            lista = new ArrayList<TabelaVerniz>();
        public Object getElementAt(int index) {
            Object item = null;
            if (lista != null) {
                item = lista.get(index);
            return item;
        public Integer getSelectedIndex(TabelaVerniz item) {
            int index = lista.indexOf(item);
            return index;
        public int getSize() {
            int size = 0;
            if (lista != null) {
                size = lista.size();
            return size;
        public void remove(int index) {
            fireIntervalRemoved(this, index, index);
            lista.remove(index);
        // This is not really working, does not update the 2nd List
        public void add(TabelaVerniz tabela) {
            if (lista == null) {
                lista = new ArrayList<TabelaVerniz>();
            lista.add(tabela);
            int index = this.getSelectedIndex(tabela);
            super.fireIntervalAdded(this, lista.size() - 1, lista.size() - 1);
    The Transfer:
    public class TabVernizTransferHandler extends TransferHandler {
        JList listaEsquerda;
        JList listaDireita;
        // This transfer handler needs to know about the two JLists !
        public TabVernizTransferHandler(JList leftList, JList rightList) {
            super();
            listaEsquerda = leftList;
            listaDireita = rightList;
        @Override
        public boolean importData(JComponent component, Transferable trasferedObject) {
            JList lista = (JList) component;
            try {
                int sourceIndex = Integer.parseInt((String) trasferedObject.getTransferData(DataFlavor.stringFlavor));
                // figure out which is the source and which is the dest.
                TabVernizListModel source;
                TabVernizListModel dest;
                if (lista == listaEsquerda) {
                    source = (TabVernizListModel) listaDireita.getModel();
                    dest = (TabVernizListModel) listaEsquerda.getModel();
                } else {
                    source = (TabVernizListModel) listaEsquerda.getModel();
                    dest = (TabVernizListModel) listaDireita.getModel();
                // get the source object
                TabelaVerniz tabela = (TabelaVerniz) source.getElementAt(sourceIndex);
                // add it to the other model.
                dest.add(tabela);
                // and remove from the source
                source.remove(sourceIndex);
            } catch (Exception ex) {
                ex.printStackTrace();
                System.out.println("Import failed!");
                return (false);
            return (true);
        @Override
        protected Transferable createTransferable(JComponent c) {
            JList jl = (JList) c;
            // we want the currently selected index
            Integer index = new Integer(jl.getSelectedIndex());
            // and we transfer it as a string
            Transferable t = new StringSelection(index.toString());
            return t;
        @Override
        public int getSourceActions(JComponent c) {
            return MOVE;
        @Override
        public boolean canImport(JComponent c, DataFlavor[] flavors) {
            for (int i = 0; i < flavors.length; i++) {
                if (flavors.getHumanPresentableName().equals("Unicode String")) {
    return (true);
    return (false);
    }Can anyone point what is wrong here?
    When I drag from the left list to the right list it just don't drop.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    The Swing tutorial on Drag and Drop has a working example with a JList.

  • Help Needed: Updated Software - And Slew of Problems Arose

    I'm soooo frustrated - and I'm hoping somebody will be able to help me. I updated my itunes and had many of the problems everyone else has seemed to have (not being able to find it or my music). I finally reinstalled the new version, and the itunes came back, but my library was empty! Then, I plugged my nano in, all my music was gone and I got a pop-up on my screen saying my ipod was corrupted. So, I restored to the factory settings, which I didn't think would matter because all my music was not on the ipod anyway -- but, it was on my hard drive. How do I get my music from my hard drive and put it into my library so that it can be restored on my ipod?

    CAGD2346,
    How do I get my music from my hard drive and put it into
    my library so that it can be restored on my ipod?
    Try these links:
    iTunes: Adding songs from the hard drive to your library
    http://docs.info.apple.com/article.html?artnum=93140
    iTunes: About the Add to Library, Import, and Convert functions
    http://docs.info.apple.com/article.html?artnum=301509
    Hope this helps you,
    Jon

  • Help needed...   File UPload  problem on remote Machine..

    Hello Helpers....
    Advance My heartfull thanks
    me have problem in file uploading...
    me have program for file upload...
    but it will work perfectly in same system.. (i mean server)..
    i cant upload in client machine..
    resourse not found (error) is comming
    me use tomcat5.0 with jdk1.4..
    Html File
    <html>
    <head>
    <form action="fileupload.jsp" name="upform" enctype="multipart/form-data">
    <table width="60%" border="0" cellspacing="1" cellpadding="1" align="center" class="style1">
    <tr>
    <td align="left"><b>Select a file to upload :</b></td>
    </tr>
    <tr>
    <td align="left">
    <input type="file" name="filename" size="50">
    </td>
    </tr>
    <tr>
    <td align="left">
    <!-- <input type="hidden" name="todo" value="upload"> -->
    <input type="submit" name="Submit" value="Upload">
    <input type="reset" name="Reset" value="Cancel">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    jsp file
    <%@ page import="java.util.*,java.io.*"%>
    <%
    String path=request.getParameter("filename");
    String newPath="";
    int count=0;
    if(path!=null)
         ArrayList arr=new ArrayList();
         StringTokenizer st=new StringTokenizer(path,"\\");
         while(st.hasMoreTokens())
              arr.add(count,st.nextToken());
              count++;
         // create ur own path
         newPath="//javaserver/Tomcat5.0/webapps/ROOT/fileupload/fl/"+arr.get(count-1);
         int c;
         FileInputStream fis=new FileInputStream(path);
         FileOutputStream fos=new FileOutputStream(newPath);
         while((c=fis.read())!=-1)
              fos.write((char)c);
    out.println("Thanks for using");
    out.println("<br>");
    out.println("<br>");
    out.println("1.File1 Uploaded from :: "+path);
    out.println("<br>");
    out.println("<br>");
    out.println("2.Uploaded File1 is Saved in :: "+newPath);
    %>
    Message was edited by:
    drvijayy2k2
    Message was edited by:
    drvijayy2k2

    hai mshanu...
    thus me asking whats wrong any other solution..
    thanks for ur ........................
    Message was edited by:
    drvijayy2k2

  • HELP NEEDED!! application and theme problem in n93...

    hey.. i encountered a few problems in my n93 which i just purchased a few days back..
    There are 2 major problems that really frustrates me..
    first, when i install a theme in the memory card and use it, the theme gets resetted to the default theme(blue one)everytime i off and on the phone..But when i install it to the phone memory everything is fine..
    secondly, when i install an application(eg agile msngr) in the memory card, it works fine. Then when i reset my phone(off and on), the application cannot seem to work.. i try to open the application but nth seems to happen.. however i found that if i ejected and inserted the sd card(when the phone is on) the application works..But when i install it to the phone memory the application works fine..
    The same also happens to the mobile filmmakers application installed in my memory card..
    ive tried to reformat the memory card but everything is still the same.. the problems still occur..
    How do i solve this problem??? i do not want to rely on phone memory for all my applications and themes.. the internal memory of 50mb is not enough..
    HELP!!

    Hello, I have the SAME problem, though I didn't see that installing applications to phone memory they keep working fine.
    Of course I also want to have them working on memory card for space reasons.
    I have recently (after LONG waiting) updated firmware to 20.0.0.58, but the problem is still there :-(
    I am sure that asking Nokia help on-line will cause the usual "contact closest assistance point"....
    which firmware version do you have ?

  • Help needed with an AIR language packaging problem

    I have a game that includes resources for the Hebrew language, however the <supportedLanguages/> tag supports only ISO 639-1 languages, and Hebrew is not listed; in fact I got a compiler/packaging error when I tried to use "he".  Currently I am getting a notice in Google play that warns me this game might not be packaged correctly: "You translated the store listing into Hebrew but not the APK."   Is there a way around this problem, perhaps some manual editing of some files somewhere?  I'd like to publish the same app to the Apple app store, I imagine they will be even less lenient there.
    We are using Flash Builder 4.7 and AIR 3.7 on Windows 7 x64 SP1.  Any assistance would be appreciated.

    It can be done for iOS. Check here: http://forums.adobe.com/message/5140906
    Don't know about Android.

  • Help needed with X-fi ex.music problems with nforce4/ asus a8n-sli del

    My x-fi extreme music doesnt work with my mb (asus a8n-sli deluxe) it gets slower and slower and finally it didnt boot win xp home.
    After disconnecting the card my system worked perfectly, strangely in the beginning i had no problems (app 2 days) and now it doesn't work
    Has anybody a solution ?

    Actually someone did post a work around they got from Logitech support. If you go here http://forums.creative.com/creativel...cending&page=5 explains temporarly changing a key in the registry. Ppl report it works so maybe give it a shot?
    mikelebron wrote:
    That problem has not been resolved yet. You will have to li've without asus update and use the dos version.. That means you will have to boot from a floppy or CD rom and get to DOS screen to do Bios updates. You can thank the creative drivers for breaking your Asus Update

  • Help Needed..... Problems with Primary Key.

    Hello all.
    ive been trying to do this for a while but not luck, im after some advice on ive got a java program connected to mysql database and i want to create a copy of a table, then be able to delete records from the new table. it seems like you cannot update copied tables because it doesnt copy the primary keys because i get
    SQLException: Result Set not updatable (referenced table has no primary keys)
    is there a way around this?
    heres what i have:
    public void createTemporyTables(){
    try{
    Statement stmt5 = conn.createStatement();
    int rows1 = stmt5.executeUpdate("CREATE TABLE tempAnimals SELECT * FROM animals");
    Statement stmt6 = conn.createStatement();
    int rows2 = stmt6.executeUpdate("CREATE TABLE tempAnimalsQuestions SELECT * FROM animalsquestions");
    if (rows1 == 0){
    System.out.println("Don't add any row!");
    else{
    System.out.println(rows1 + " row(s)affected.");
    if (rows2 == 0){
    System.out.println("Don't add any row!");
    else{
    System.out.println(rows2 + " row(s)affected.");
    catch(Exception e)
    System.out.println("SQLException: " + e.getMessage());
    System.out.println("Method = createTemporyDatabase Error");
    public void remove(){
    try{
    Statement stmt13 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    ResultSet yesItems = stmt13.executeQuery("SELECT * FROM tempanimals WHERE Q5 =\"y\"");
    Statement stmt14 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    ResultSet yesQuestions = stmt14.executeQuery("SELECT * FROM tempanimalsquestions WHERE question = '5'");
    while(yesItems.next())
    yesItems.deleteRow();
    while(yesQuestions.next())
    yesQuestions.deleteRow();
    catch(Exception e)
    System.out.println("SQLException: " + e.getMessage());
    System.out.println("Method = removeYes Error");
    any help will be much appreciated..
    Ben

    Hi,
    Your temperary table has no primary key. Mention primary key field, when creating temperary table. See below statement change primary key field according to you.
    int rows1 = stmt5.executeUpdate("CREATE TABLE tempAnimals (primary key(animalid)) SELECT * FROM animals");
    int rows2 = stmt6.executeUpdate("CREATE TABLE tempAnimalsQuestions (primary key(questionid)) SELECT * FROM animalsquestions");Regards,
    Ram.

  • Help needed for strange signal drop out problem

    My iphone 3G does this odd thing -
    The phone will show a strong 3G signal until I open an app that uses data, or try to make a call. Then the signal suddenly vanishes and the connection fails. If I wait 10 seconds it comes back and it's fine. Also it seems I am missing calls while the phone is locked.
    When I disable 3G under the network settings the problem seems to go away.
    Has anyone one else had similar issues or been able to solve the problem?
    Many thanks.
    Luke

    I have the samme issue ever since 3.x software came out. HAvent been able to use 3G since and have been operating on Edge without issues. Very dissapointing as its definitely a software problem and been going on for ages...even the newest update 3.1.3 hasnt fixed it...

  • Help Needed: sjsas9 download location and install problem

    Running XP SP2
    Downloading file: sjsas-pe-9_0_01_p01-windows.exe (40818KB)
    and then trying to install, the installation fails and the error logs show App Server 8.1 not 9.1???
    sjsas-pe-9_0_01_p01-nb-5_5-windows.exe (96575KB) show the same thing: Sun Appserver 8.1 not 9.1
    Both files were downloaded from the Sun Download site on different days.
    I thinking If i got the right "package" (.exe file) Sun Java System Application Server 9.0 update 1 PE, the app server might actually install w/o error (exit code 151)..
    Thanks for you help

    Please explain this? I never done that before.
    In Help I clicked Deactivate and then see a pop up box with 2 choices, Suspend Activation or Deactivate Permanently.
    I hit the Cancel button at the bottom for now.
    If this don't work I will Call Adobe on Monday and hopefully get it all worked out, or I will be packing up Both CS5 Upgrades I just bought and send them both back to Amazon for a full Refund.
    This should NOT be such a P.I.T.A. just because a few kids hack and use photoshop without actually paying for it.
    I am 50 years old BTW, and Paid for my Legit copys, but I gotta jump through Hoops as punishment for a few who don't pay.
    Myleniums answer sure sounds like a big pain in the a** to go through and I'd just Return the CS5 stuff, Including the CS5 Illustrator I just upgraded as well. As a Amazon Prime Member they will take it all back and refund me my cash.
    As a rare user, just for myself at home, I only Upgraded because I knew Adobe only allowed you to get 3 versions behind before you had to rebuy the full install software all over again so I waited until I thought it was getting close to CS6 coming out and I would Not be able to upgrade at the upgrade pricing. And the CS6 Licensing I read about coming up does NOT appeal to me.
    So CS2 or CS5 will be it for me and Adobe. As a Hobbiest I cant afford to do upgrades for each new version. /i heard starting with CS6 you will be Required to upgrade when the very next one comes out, not able to skip a version. Or even some silly monthly fee type thing, Never will I pay a Monthly fee for software use.

  • Shortest path issue

    Hey guys, first...Happy thanksgiving :)
    Ok, so I'm on my last assignment for my amazingly taught Data Structures class. I battled my way successfully through recursion, binary trees, redblack trees, 234 trees, B Trees, and heaps!...no issues at all!....but, now I have hit graphs. I understand the concept, but my latest assignment has me a bit frustrated..Im so close to finishing I can taste it!!....I just cant find the spoon..
    Here we go:
    We are given a graph on paper. It has circles (verteci) representing cities in the USA. These circles are connected by lines (edges) representing the distance between the cities. Also, the lines have arrows pointing the direction they may be traversed.
    We are to construct the graph in the computer, and then compute the shortest path from washington (Vertex 0) to every other city.
    I managed to construct the graph, and it will find the shortest path no problem. My only issue is that, it wants us to print the path it took, not just the destination and total distance....
    I have tried using a stack to push the verteci onto as theyre visited, but im not getting happy results.
    I should also mention, this code is taken out of the book with modifications by me so that it can add edges and verteci, and it now accepts String types for the vertex labels instead of characters.
    Here is my code
    PATH.JAVA (the important part)
    // path.java
    // demonstrates shortest path with weighted, directed graphs
    // to run this program: C>java PathApp
    import java.lang.*;
    import java.io.*;
    class DistPar               // distance and parent
    {                           // items stored in sPath array
        public int distance;    // distance from start to this vertex
        public int parentVert;  // current parent of this vertex
        public DistPar(int pv, int d)  // constructor
            distance = d;
            parentVert = pv;
    }  // end class DistPar
    class Vertex
        public String label;        // label (e.g. 'A')
        public boolean isInTree;
        public Vertex(String lab)   // constructor
            label = lab;
            isInTree = false;
    }  // end class Vertex
    class Graph
        private final int MAX_VERTS = 20;
        private final int INFINITY = 1000000;
        private Vertex vertexList[];    // list of vertices
        private int adjMat[][];         // adjacency matrix
        private int nVerts;             // current number of vertices
        private int nTree;              // number of verts in tree
        private DistPar sPath[];        // array for shortest-path data
        private int currentVert;        // current vertex
        private int startToCurrent;     // distance to currentVert
        private stack path_taken;       // stack to record path taken
        public Graph()                  // constructor
            vertexList = new Vertex[MAX_VERTS];
                                             // adjacency matrix
            adjMat = new int[MAX_VERTS][MAX_VERTS];
            nVerts = 0;
            nTree  = 0;
            for(int j=0; j<MAX_VERTS; j++)      // set adjacency
                for(int k=0; k<MAX_VERTS; k++)  //     matrix
                    adjMat[j][k] = INFINITY;    //     to infinity
            sPath = new DistPar[MAX_VERTS];     // shortest paths
            path_taken = new stack(MAX_VERTS);
        }  // end constructor
        public void addVertex(String lab)
            vertexList[nVerts++] = new Vertex(lab);
        public void addEdge(int start, int end, int weight)
            adjMat[start][end] = weight;  // (directed)
        public void path()                // find all shortest paths
            int startTree = 0;             // start at vertex 0
            vertexList[startTree].isInTree = true;
            nTree = 1;                     // put it in tree
          // transfer row of distances from adjMat to sPath
            for(int j=0; j<nVerts; j++)
                int tempDist = adjMat[startTree][j];
                sPath[j] = new DistPar(startTree, tempDist);
          // until all vertices are in the tree
            while(nTree < nVerts)
                int indexMin = getMin();    // get minimum from sPath
                int minDist = sPath[indexMin].distance;
                if(minDist == INFINITY)     // if all infinite
                {                        // or in tree,
                    System.out.println("There are unreachable vertices");
                    break;                   // sPath is complete
                else
                {                        // reset currentVert
                    currentVert = indexMin;  // to closest vert
                    startToCurrent = sPath[indexMin].distance;
                    // minimum distance from startTree is
                    // to currentVert, and is startToCurrent
                // put current vertex in tree
                vertexList[currentVert].isInTree = true;
                nTree++;
                path_taken.push(sPath[indexMin]);
                adjust_sPath();             // update sPath[] array
            }  // end while(nTree<nVerts)
            displayPaths();                // display sPath[] contents
            nTree = 0;                     // clear tree
            for(int j=0; j<nVerts; j++)
                vertexList[j].isInTree = false;
        }  // end path()
        public int getMin()               // get entry from sPath
        {                              //    with minimum distance
            int minDist = INFINITY;        // assume minimum
            int indexMin = 0;
            for(int j=1; j<nVerts; j++)    // for each vertex,
            {                           // if it's in tree and
                if( !vertexList[j].isInTree &&  // smaller than old one
                                   sPath[j].distance < minDist )
                    minDist = sPath[j].distance;
                    indexMin = j;            // update minimum
            }  // end for
            return indexMin;               // return index of minimum
         }  // end getMin()
        public void adjust_sPath()
          // adjust values in shortest-path array sPath
            int column = 1;                // skip starting vertex
            while(column < nVerts)         // go across columns
             // if this column's vertex already in tree, skip it
                if( vertexList[column].isInTree )
                    column++;
                    continue;
             // calculate distance for one sPath entry
                           // get edge from currentVert to column
                int currentToFringe = adjMat[currentVert][column];
                           // add distance from start
                int startToFringe = startToCurrent + currentToFringe;
                           // get distance of current sPath entry
                int sPathDist = sPath[column].distance;
             // compare distance from start with sPath entry
                if(startToFringe < sPathDist)   // if shorter,
                {                            // update sPath
                    sPath[column].parentVert = currentVert;
                    sPath[column].distance = startToFringe;
                column++;
             }  // end while(column < nVerts)
        }  // end adjust_sPath()
        public void displayPaths()
            for(int j=0; j<nVerts; j++) // display contents of sPath[]
                System.out.print(vertexList[j].label + "="); // B=
                if(sPath[j].distance == INFINITY)
                    System.out.print("inf");                  // inf
                else
                    System.out.print(sPath[j].distance);      // 50
                    String parent = vertexList[ sPath[j].parentVert ].label;
                    System.out.print(" (" + parent + ") ");       // (A)
            System.out.println("");
            System.out.println("PRINTING path_taken");
            DistPar thing = null;
            while((thing = path_taken.pop()) != null)
                System.out.println(" " + vertexList[thing.parentVert].label + " "+ thing.distance);
    }  // end class GraphSTACK.JAVA (my stack class)
    // stack.java
    // demonstrates stacks
    // to run this program: C>java StackApp
    class stack
        private int maxSize;        // size of stack array
        private DistPar[] stackArray;
        private int top;            // top of stack
        public stack(int s)         // constructor
            maxSize = s;             // set array size
            stackArray = new DistPar[maxSize];  // create array
            top = -1;                // no items yet
        public void push(DistPar j)    // put item on top of stack
            stackArray[++top] = j;     // increment top, insert item
        public DistPar pop()           // take item from top of stack
            return stackArray[top--];  // access item, decrement top
        public DistPar peek()          // peek at top of stack
            return stackArray[top];
        public boolean isEmpty()    // true if stack is empty
            return (top == -1);
        public boolean isFull()     // true if stack is full
            return (top == maxSize-1);
    }PATHAPP.JAVA (test program..builds the graph and calls path())
    class PathApp
        public static void main(String[] args)
            Graph theGraph = new Graph();
            theGraph.addVertex("Washington");
            theGraph.addVertex("Atlanta");
            theGraph.addVertex("Houston");
            theGraph.addVertex("Denver");
            theGraph.addVertex("Dallas");
            theGraph.addVertex("Chicago");
            theGraph.addVertex("Austin");
            theGraph.addEdge(0,1,600);
            theGraph.addEdge(1,0,600);
            theGraph.addEdge(0,4,1300);
            theGraph.addEdge(4,3,780);
            theGraph.addEdge(3,1,1400);
            theGraph.addEdge(1,2,800);
            theGraph.addEdge(2,1,800);
            theGraph.addEdge(4,5,900);
            theGraph.addEdge(4,6,200);
            theGraph.addEdge(6,4,200);
            theGraph.addEdge(6,2,160);
            theGraph.addEdge(3,5,1000);
            theGraph.addEdge(5,3,1000);
            System.out.println("Shortest Paths");
            theGraph.path();
            //theGraph.displayPaths();
            System.out.println();
    }Im mostly having trouble comprehending the Path.java file. A few friends and I stared at it for a few hours and couldnt get it to do what we wanted...
    path_taken is the stack I added in to try and push/pop the verteci as theyre traversed, but with what I stuck in right now, it still just prints the most recently visited vertex, and the sum of the distances.
    Any help is greatly appreciated!
    Thanks :)
    ----Arkhan

    If your graph is G(V, E), and you're trying to get to vertex v_end, then create a new graph G'(V', E') whereV' = (V x N) U {v_end'}
        (v_end' is a new object)
    E' = {((u, t), (v, t + f(u, v, t))) : (u, v) in E, t in N} U
         {((u, t), (u, t + 1)) : u in V, t in N} U
         {((v_end, t), v_end') : t in N}G' is infinite, so you'll need to use a lazy graph structure. Then just use Dijkstra from (v_start, 0) to v_end'.

Maybe you are looking for

  • How can I get imovie to open my movies made on previous iMac?

    I have transferred all my movies from my old computer (iMac 10.5.3) to a new 27" on OS 10.6.5. I have resisted installing the newest iLife after some warnings against doing so. The new version of iMovie won't open my movies which are listed there, bu

  • PR Short text getting copied to the Item text

    Hi All, I have a scenario in which i need the PR short text getting copied to the Item text while creating a PR. Please let me know if there are any settings for the same. Thanks,

  • Unchanged the block Reason in FB02/FB09

    In the standard settings the payment block "A" can be removed from a document using FB02/FB09 transaction. We want that user should not be able to change the block "A" from the document using FB02/FB09, the payment block field should be greyed out. H

  • Change Partners at item level for a LUMF

    Hi does anyone know how i can change the item partner address on a material that has an item cat grp of LUMF, i can chage the sub items but not this one? Regards Steve

  • Java.lang.UnsatisfiedLinkError: DBDisconnect

    Hi Guys, I tried using the Connection pool APIs from db2jcc.jar for DB2 UDB v8.1. While i try to execute the following code i got the exception java.lang.UnsatisfiedLinkError: DBDisconnect. Please help me to find the problem, there is no .dll to be l