cvec ← wgraph ##.wcost path  ⍝ Cost vector for path ⍵ through weighted graph ⍺.

The  result,  [cvec]  is  the  cost-per-edge for the _path_ through the weighted
graph  [wgraph].  Note that the resulting cost vector has one less item than the
path.

Examples:

    aa                              ⍝ simple weighted graph.
┌───┬─┬───┬───┬─┐
│2 3│3│2 4│1 5│3│
├───┼─┼───┼───┼─┤
│1 3│1│4 1│1 1│1│
└───┴─┴───┴───┴─┘

    aa wcost 1 3 4 5 3 2 3 2        ⍝ cost of path through graph.
3 1 1 1 4 1 4

See also: wGraphs wspan wpath

Back to: contents

Back to: Workspaces