Results 1 to 25 of 25

VBA - Tree visualisation. Possibly the hardest algo logic ever to code

Threaded View

  1. #1
    Registered User
    Join Date
    06-20-2017
    Location
    london
    MS-Off Ver
    2010
    Posts
    38

    VBA - Tree visualisation. Possibly the hardest algo logic ever to code

    I've been stuck here for hours trying to come up with a VBA excel logic for this problem. Think of this as a tree problem, in which the number of branches/nodes is determined by the user and inputted at the start.

    For every node, there is 3 possible outcomes, staying flat, increasing by 1% or decreasing by 1%.

    I thought about it and faced the following problems, was wondering if this makes sense or if its even doable:

    1) The row insertion to build a "tree" is computationally expensive, no way around it. While this is fine for a small number of nodes, a bigger tree would just take hours for a click of the macro! ( i intend to use this up to 11/12 nodes, which takes way too long!)
    - Is it possible to build a solution where macro calculations uses the same "tree" once it has been generated once, rather than to regenerate the tree every single click. i.e. to spilt up the processes, i would run a tree with 12 node at the start. And afterwhich the tweaking of the input values simply generates values that shows itself up in the tree, rather than cleaning the sheets and inserting new rows again.

    2) Let me illustrate whats going on here in the best way i can.
    The initial value of 100, which was used for this test, will be replaced by a formula. Lets call this formula, (A*B*Sqrt(C) + 6/X), where A, B, are constants and X is the initial % move input in the sheet which the tree branches are based off. C is the tricky bit - this is assumed to be constant until a manual intervention comes in.

    Lets for a moment assume a simple tree model, with 5 nodes - giving the following structure. 1, 3, 9, 27, 81 ,243 ... 3^n, where n is the number of nodes.
    Running this formula with an initial input of 2%, whereby X = 2%.
    We get a nice small tree with values at this point of time.
    I am trying to build a more dynamic tree here, whereby i can step in for e.g. on the 2nd value of node 3, adjust the input for C and see how the dependant nodes changes. All without affecting the previously assumed C value on nodes 1 & 2, and nodes not directly affected by the forward path of this particular value.

    So in this picture below, only the blue paths should be affected by the new C value input. Is this something possible? I am so stuck...

    Attachment 530711
    Attached Images Attached Images
    Last edited by songhaegyo; 07-29-2017 at 09:08 PM. Reason: updated with new problem set and issues.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pipe visualisation
    By cooksteve09 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-01-2017, 05:03 AM
  2. Data Visualisation
    By KING9 in forum Excel General
    Replies: 0
    Last Post: 12-11-2013, 12:03 PM
  3. using excell for material selection possibly a logic problem
    By pault125 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2013, 12:17 PM
  4. IF/AND Formula Logic Tree
    By quibilty in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-18-2013, 08:43 PM
  5. [SOLVED] Logic Tree to IF/AND Formula Conversion
    By quibilty in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-19-2013, 11:00 AM
  6. Code for email alerts from excel isn't working, wrong code possibly?
    By jessthorogood in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 01:45 AM
  7. Logic Tree, MS help = useless
    By roffler in forum Excel Formulas & Functions
    Replies: 63
    Last Post: 09-06-2005, 07:05 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