<!--/*SC*/DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"/*EC*/-->
<html><head><title></title><style type="text/css"><!--body{padding:1ex;margin:0px;font-family:sans-serif;font-size:small;}a[href]{color:-moz-hyperlinktext !important;text-decoration:-moz-anchor-decoration;}blockquote{margin:0;border-left:2px solid #144fae;padding-left:1em;}blockquote blockquote{border-color:#006312;}blockquote blockquote blockquote{border-color:#540000;}--></style></head><body><div style="font-family: Arial; font-size: medium;" dir="ltr"><div>Wondering if there's a Python library or algorithm for determining the order in which a group of calculations should be performed when some calculations reference the result of other equations. I don't need anything as fancy as a spreadsheet engine, however I do need to detect recursive equations and treat these situations as errors.</div>
<div> </div>
<div>In terms of an example: What I would like to do is order the following equations such that all the dependent variables are calculated before they are referenced by later calculations.</div>
<div> </div>
<div>a + b + c = d</div>
<div>a + b + d = e</div>
<div>a + e = f</div>
<div>d + e + f = g</div>
<div>a + e = h</div>
<div> </div>
<div>Thank you,</div>
<div>Malcolm</div>
<div> </div></div></body></html>