views:

455

answers:

4

I am interested in learning how dependency-based calculation engines work in practice. Of course, I can make up my own algorithm, but I was curious if there were any well explained algorithms that are used in practice.

I have tried Google, but most articles are < "good".

+11  A: 

http://www.decisionmodels.com/calcsecretsc.htm has the best description I've seen of how the Excel calculation engine behaves with some discussion of the mechanics.

Hobbo
+2  A: 

I don't know if this actually answers your question but maybe you want to look at the source for Gnumeric or Open Office Calc?

Onorio Catenacci
Unfortunately, extracting "algorithm" from "code" is very difficult. Maybe one of those pieces of software is in fact readable, but given that they're huge projects written in C, I doubt it.
Frank Krueger
+2  A: 

I created a dependency-based Winforms library called Update Controls. It's an open-source project, so you can see how I solved the problem.

Michael L Perry
+5  A: 

I know that this is a late post, but I couldn't help but add...

I agree that the Excel's Calculation Process Article from Decision Models is one of the best overviews for how Excel handles its calculations.

In addition, one of the best articles for understanding the dependency algorithm itself is from Microsoft: Recalculation in Microsoft Excel 2002. It describes how the dependency-based calculation engine works for Excel 2002 in pretty good detail.

There is also an excellent example from the Code Project: Implementing an Excel-like formula engine which is an great code example if you are looking to "write your own".

Mike Rosenblum
No problem posting late - as I understand it this place is supposed to be a cross between Wikipedia and a newsgroup
MarkJ
Yeah, and these are a couple of good links so I couldn't resist. Actually, they're better than the Decision Models articles if one really wants to understand the *algorithm* involved, which I think is the heart of what the question asked.
Mike Rosenblum