caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Diego Olivier Fernandez Pons <dofp.ocaml@gmail.com>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Dynamic graph algorithms
Date: Fri, 18 Nov 2011 12:13:06 +0100	[thread overview]
Message-ID: <CAHqiZ-+V7THucvprxEgStPPdfJs1SqgDoOxKUHkPOg_Yh9SQ=w@mail.gmail.com> (raw)
In-Reply-To: <CAHqiZ-KQxkc6cWLCfrMok=rz=U_Psg=DA=Mvrtm+w3rijgd_3A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2115 bytes --]

    Jon,

I was told my explanations weren't very clear so here it goes with more
details, a much simpler example and explicit links

A dynamic graph algorithm is a classical graph algorithm (say all-pairs
shortest path) that is able to update the result when there is a small
modification of the input without computing everything from
scratch. Typical usage are large networks, for instance adding a fiber
optic cable in a suburb of Paris won't change the shortest path between New
York and San Francisco, therefore computing everything from scratch again
is unnecessary.

There are 2 ways of achieving that result
- recomputation : pretty much like backtracking debuggers in functional
languages, they "save" a previous state and re-execute the computation
tree/DAG from there
- dedicated algorithm that "fix" the result in place : STOC / FOCS like
algorithms


Lets take a very simple example fun f a b c -> f a + f b + f c

The computation tree is something like
evaluate f a
evaluate f b
evaluate f c
evaluate f a + f b + f c

if now there is a small change in a, say a -> 'a the backtracking
algorithms will do the following

evaluate f 'a
read f b from memory
read f c from memory
evaluate f 'a + f b + f c

the typical problems to solve are similar to backtracking debuggers in
functional languages : efficiently save intermediate states, optimise fully
reversible transformations, etc.
Umut Acar with his self-adjusting ML is a typical representative of that
kind of work as well as backtracking debuggers (Caml, SML)
http://umut.mpi-sws.org/self-adjusting-computation


A dedicated algorithm instead will use the mathematical properties of the
object being built to "fix in place" the result

evaluate f a
evaluate f 'a
evaluate delta = f 'a - f a
read f a + f b + f c from the result
evaluate f a + f b + f c + delta

Notice this algorithm doesn't require the first algorithm to memoize any
intermediate computation
David Eppstein and other American algorithmicians are typical
representatives of this line of work
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.8372


        Diego Olivier

[-- Attachment #2: Type: text/html, Size: 2910 bytes --]

      reply	other threads:[~2011-11-18 11:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 21:59 Jon Harrop
2011-11-10 11:13 ` Diego Olivier Fernandez Pons
2011-11-18 11:13   ` Diego Olivier Fernandez Pons [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHqiZ-+V7THucvprxEgStPPdfJs1SqgDoOxKUHkPOg_Yh9SQ=w@mail.gmail.com' \
    --to=dofp.ocaml@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=jon@ffconsultancy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).