Assume Joe visits Washington, London, Paris and Moscow You start with records like Joe:Washington:20-Jan-2011 Joe:London:14-Feb2011 Joe:Paris :9-Mar-2011
You want Joe: Washington, London, Paris and Moscow For the next step the person is irrelevant you want Washington: London:1, Paris:1 ,Moscow:1 London: , Paris:1 Moscow:1 Paris: Moscow:1 The first say after a visit to Washington there was one visit to London, one to Paris and one to Moscow This can be combined with the one from Joe Now suppose Bill visits London and Moscow So he generates London: Moscow:1 This can be combined with the one from Joe saying London: , Paris:1 and Moscow:1 to give London: , Paris:1 and Moscow:2 Now suppose Sue visits London and Riga and Paris So she generates London: , Paris:1,Riga 1 This can be combined with London: , Paris:1 and Moscow:2 to give London: , Paris:2 and Moscow:2,Riga 1 Note I can keep places in alphabetical order in the result On Tue, Jul 19, 2011 at 9:53 AM, Em <mailformailingli...@yahoo.de> wrote: > Hi Steven, > > thanks for your response! For the ease of use we can make those > assumptions you made - maybe this makes it much easier to help. Those > little extras are something for after solving the "easy" version of the > task. :) > > What do you mean with the following? > > > The second job takes Person : list of places and return for each place > > in the list consructs > > place : 1 | place after P : 1 | next place : 1 ... > > You mean something like that? > > Washington DC:1 > New York after Washington DC:1 > Miami after New York:1 > > I do not see the benefit for the result I like to get? > > The end-result should be something like that: > Washington DC => New York, Miami, Los Angeles > New York => Chicago, Seattle, San Francisco > > The point is, that one can see that persons that visited Washington DC > are likely to visit New York as the next place, Miami as the second and > L.A. as the third. > However, if I choose New York as my starting point, I can see that > persons that start their journey in New York (and maybe weren't in DC > before) are likely to visit Chicago, Seattle and San Francisco. Maybe > Los Angeles comes at the 10th position. > > Regards, > Em > -- Steven M. Lewis PhD 4221 105th Ave NE Kirkland, WA 98033 206-384-1340 (cell) Skype lordjoe_com