# Take Your Learning One Step Further - Directed Acyclic Graph (DAG)

edited February 2023 in Modeling

Hi Learners!!

I just watched the most amazing YouTube video today about Graph theory. It's a 15 minute video and at 8:50 the concept of a directed acyclic graph, or DAG, is introduced. A DAG is at the heart of Anaplan's calculation engine. When you edit a cell in a grid, Anaplan immediately calculates all the paths it must take to calculate the changes based on the edit you just made. Enjoy!!

• edited December 2022

Thanks for sharing, @JaredDolich!

• edited December 2022

Thank you for sharing this video, @JaredDolich!

I wanted to clarify one thing: Does Anaplan use DAG for blocks or for the whole Line Items?

• edited December 2022

I cannot say for certain since I'm not on the development team but what I can tell you is that every time you create a formula, Anaplan immediately generates the DAG for that line item in all directions within the model. Some of the DAGs are long meaning there is a lot of daisy chaining (which causes performance degradation).

The key feature to be aware of is that Anaplan's use of a DAG is closed. You cannot manipulate or change any of the paths. There are planning solutions, like Blue Yonder's (BY) Enterprise Planning, for example that allows you to edit the DAG. In my opinion, this is why it's next to impossible to upgrade BY because if you decide to change a formula, you'll have to visit every single DAG that's impacted and make sure you didn't cause a circular reference or an unintended calculation.

Here's an example. Let's say I have this inventory balance set:

Ending Period Inventory = Beginning Period Inventory + Inventory Adds (Receipts) - Inventory Reductions (Sales)

In Anaplan, you cannot edit the ending period inventory since the DAG is closed. Anaplan knows that if you edit any of the values on the right side of the equation, there is a single path to take and it will not cause any issues throughout the model.

In BY, both sides of the equation are editable. That means YOU must program the DAG. So if I change the Ending Inventory, which line item do you want to flex? The inventory reductions or the inventory adds? And by changing the inventory reductions, what other calculations will be affected? And, on and on... Too difficult and expensive to change.

Closed DAG is brilliant, simple, and efficient. But, you give up the ability to edit both sides of the equation, a VERY popular feature to end users.

• edited December 2022

Thanks for sharing this

________________________
michel miotto barbosa

+55 11 984 342 347

mmiottobarbosa@gmail.com