I am sorry but so no one knows if "run sums" is possible or even a good 
feature ?? Sorry for keep replying to this thread but i fail to see how 
this can not be a useful thing in many cases.
See a similar SQL alternative:

http://sqlfiddle.com/#!2/76f81/9

Rik van Bruggen recently posted this on his blog
http://blog.bruggen.com/2014/03/using-neo4j-to-manage-and-calculate.html

While fantastic and really useful and innovative it would be even better if 
i could get the products that falls within a certain cost threshold based 
on a running sum for the nodes so i could for example balance an assembly 
line with stations that falls under certain time limit.
It might be possible however i always fail to make it work when running sum 
or reduce aggreates.

Thanks you.



Den fredagen den 28:e mars 2014 kl. 14:14:58 UTC+1 skrev Lundin:
>
> Hi again,
>
> Any ideas or input to simplify the problem? Would be possible to halt the 
> traverseal until a specific threshold has been reached ?
>
> I haven't tried all possible functions, maybe something with a FOREACH and 
> then a CASE scenario would evaluate each traversal and return the result 
> upon satisfying the threshold ?
>
> Thanks
>
> Den onsdagen den 26:e mars 2014 kl. 12:22:54 UTC+1 skrev Lundin:
>>
>> Hello!
>>
>> I have already posted a similar thing on stackoverflow and i mean in no 
>> way to cross-post the actual problem (which is all made up btw)  but rather 
>> understand why a graph algorithm couldnt be useful when solving certain 
>> problems
>>
>> http://stackoverflow.com/questions/22646305/is-there-anything-like-a-do-while-match-pattern-that-satisfy-an-aggregated-val
>>
>> So, i posted that before i even knew there was something called knapsack 
>> problem:
>> http://rosettacode.org/wiki/Knapsack_problem/0-1
>>
>> where a problem is forumlated as
>> *Which items does the tourist carry in his knapsack so that their total 
>> weight does not exceed 400 dag [4 kg], and their total value is maximised?*
>> I think this question combined with a graph pattern is useful becuase the 
>> traversal is actually taking place so the cost could be calculated.
>>
>> And in many ways this is much similar to what i am trying to understand 
>> how graph query can be used or am i wrong on this ? Should it be on 
>> application level only?
>>
>> What i eventually would like to do is to test the reduce/accumulator 
>> function or limit not only on rows but on actual property values if that 
>> make sense.
>>
>> Assume we have a graph with people and page nodes. The page nodes have 
>> stats on them. This query accumulates the stats for the pages a person has 
>> visited
>>
>> MATCH (n:People)-[:VISITS]-sites WITH reduce(acc=0, x IN collect(sites.
>> dailyhits)| acc + x) AS totalhits RETURN totalhits;
>>
>>
>> I thinks an expression like this could be useful to limit the pattern:
>>
>> MATCH (n:People)-[:VISITS]-sites WITH reduce(acc=0, x IN collect(sites.
>> dailyhits)| acc + x) AS totalhits WHERE totalhits<50000 RETURN totalhits;
>>
>> I understand why it doesnt work, but the idea of evaluate an expression 
>> for each graph traverse or compare paths seems to be a very useful way of 
>> getting a more appropriate resultsets for some problems.
>>
>> Any inputs or general ideas ?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to