Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Example for NetworkFlow function

11 views
Skip to first unread message

Karsten W.

unread,
Feb 26, 2009, 7:59:32 AM2/26/09
to
Hello,

can you point me to a minimal commented example of the NetworkFlow
function?

I have a graph with sources, sinks and transshipment nodes and I do
not know how to specify these nodes as function parameters.

Any hint appreciated,
kind regards,

Karsten.

Sjoerd C. de Vries

unread,
Mar 1, 2009, 4:57:24 AM3/1/09
to
Not sure whether this helps, but as an example the network in the
wikipedia article (http://en.wikipedia.org/wiki/Flow_network)
translates to (if I'm interpreting everything right):

NetworkFlow[FromAdjacencyMatrix[{{Infinity, 5, 3, Infinity, Infinity,
Infinity}, {0, Infinity, 2, 3, Infinity, Infinity},
{0, 2, Infinity, Infinity, 4, Infinity}, {Infinity, 0,
Infinity,
Infinity, 1, 2}, {Infinity, Infinity, 0, 0, Infinity, 5},
{Infinity, Infinity, Infinity, 0, 0, Infinity}},
EdgeWeight], 1, 6]

You're talking about sinks and sources. Judging from the documentation
I'd say only one sink and one source are possible.

Cheers -- Sjoerd

On Feb 26, 2:59 pm, "Karsten W." <Karsten.G.Wein...@googlemail.com>
wrote:

0 new messages