+ Reply to Thread
Results 1 to 7 of 7

Starting point - picture of pipe network. Ending point - calculation of longest route!

  1. #1
    Registered User
    Join Date
    05-27-2018
    Location
    Dubai, UAE
    MS-Off Ver
    2010
    Posts
    2

    Exclamation Starting point - picture of pipe network. Ending point - calculation of longest route!

    Hi,

    I have a network of pipes (main line breaking into branches and sub-branches).

    What I would like to do is calculate the longest route if I were to start at the beginning.

    I have the CAD drawing which gives me all the branches and lengths.

    I want to know how I should arrange this information in excel (should I make a table?) and how I can automate it so that if I put in the variables it calculates the longest length.

    Does anyone know how this can be done??

    Thanks!
    Attached Images Attached Images

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,917

    Re: Starting point - picture of pipe network. Ending point - calculation of longest route!

    So, what would your expected outcome be? What is the answer you are looking for based on the diagramme? What is the manual calculation?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-27-2018
    Location
    Dubai, UAE
    MS-Off Ver
    2010
    Posts
    2

    Re: Starting point - picture of pipe network. Ending point - calculation of longest route!

    Thanks for the quick response!

    My expected outcome is for excel to calculate which route is the longest (sum the total longest route).

    Based on the example when you start from the top there are three possible outcomes:

    1. 8m + 5m = 13m
    2. 8m +10m + 1m = 19m
    3. 8m + 10m + 4m + 5m = 27m

    So what I would like is for excel to be able to tell me that the longest route is 27m.

    I hope this makes sense.

    Thanks

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,917

    Re: Starting point - picture of pipe network. Ending point - calculation of longest route!

    I'm not clear in my own mind how this would work, and you have not indicated how it might change or how Excel would get the data, but I suppose that this might be a starting point:

    Excel 2016 (Windows) 32 bit
    B
    C
    D
    E
    2
    Phase
    Start
    End
    Length
    3
    1
    Y
    N
    8
    4
    2
    N
    Y
    5
    5
    2
    N
    N
    10
    6
    3
    N
    Y
    1
    7
    3
    N
    N
    4
    8
    4
    N
    Y
    5
    Sheet: Sheet1

    We probably need to know more about the variables before trying to offer a formula or VBA solution.

  5. #5
    Registered User
    Join Date
    05-27-2018
    Location
    UK, London
    MS-Off Ver
    2013
    Posts
    11

    Re: Starting point - picture of pipe network. Ending point - calculation of longest route!

    Wow, it's too complicated, but interesting

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Starting point - picture of pipe network. Ending point - calculation of longest route!

    To solve for the general case, you'd start by labeling the nodes and the distances between:

    A
    B
    C
    D
    E
    F
    G
    A
    8
    B
    8
    5
    10
    C
    5
    D
    10
    1
    4
    E
    1
    F
    4
    5
    G
    5


    Then write some code that does a graph traversal (like running a maze), evaluate all possible paths that don't visit the same node twice, and select the longest. The code to do this is fussy, and the run time goes up exponentially with the numbers of nodes and connections.
    Last edited by shg; 05-27-2018 at 02:17 PM.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Starting point - picture of pipe network. Ending point - calculation of longest route!

    Here's an example:

    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    3
    From\To
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    Node
    Distance
    4
    A
    88
    57
    88
    J
    O4:O13: {=TRANSPOSE(LongestPath(C3:M13))}
    5
    B
    57
    58
    A
    92
    P5: =INDEX($D$4:$M$13, MATCH(O4, $D$3:$M$3, 0), MATCH(O5, $C$4:$C$13, 0))
    6
    C
    27
    39
    54
    69
    47
    I
    57
    7
    D
    88
    59
    F
    53
    8
    E
    32
    14
    25
    H
    82
    9
    F
    82
    C
    99
    10
    G
    19
    79
    91
    39
    D
    27
    11
    H
    49
    35
    99
    20
    92
    94
    65
    B
    88
    12
    I
    53
    27
    G
    58
    13
    J
    92
    23
    85
    16
    E
    79
    14
    Total
    635
    P14: =SUM(P3:relN)


    Those 33 connections among 10 nodes required evaluation of 1463 paths.

    I'll post the workbook if you're comfortable with a VBA solution.
    Last edited by shg; 05-28-2018 at 01:54 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Starting point
    By Phyxius in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2016, 03:58 PM
  2. [SOLVED] sum numbers over several sheets with varing starting / ending point
    By hänschendampf in forum Excel General
    Replies: 13
    Last Post: 03-30-2016, 11:26 AM
  3. Starting Point
    By JT_2111 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-10-2014, 02:45 PM
  4. Index/Match to find Starting Point of Average, Ending Point of Average Variable
    By tgentry in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-09-2012, 01:04 AM
  5. Replies: 2
    Last Post: 06-27-2011, 10:47 PM
  6. Charts with setting starting and ending point on x (time)
    By yuri in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 07-24-2008, 08:28 AM
  7. Starting point
    By LouP in forum Excel General
    Replies: 1
    Last Post: 05-15-2008, 12:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1