from Hacker News

Ask HN: What are data structures important to event sequences?

by goloroden on 10/18/23, 7:22 PM with 1 comments

I am trying to delve into the analysis of event sequences (i.e., sequences of temporally non-discrete events). Typical questions are: Which event often happens after which other event? How much time on average passes between two events of type X? Are there events that occur particularly frequently during certain seasons? And so on ... mainly questions regarding frequency, time, or probability of one event or multiple events and their relationships to each other.

However, I find little material on this on the internet. There are a few pieces of information on event sequences. There's much more on time-series topics, but that's a bit different. What algorithms, data structures, etc. should one be familiar with if one wants to deal with the analysis and prediction of events? And what keywords should I watch out for?

  • by eimrine on 10/19/23, 8:56 AM

    I am in a researching of a similar problem and here is what I can tell you.

    Suppose a program which accepts some requests from Internet (server in client-server terminology). One request needs 1 second to get done, but the client might send you either 1 request per 10 seconds in best case, because the server has 9 seconds to poke or 10 requests per 1 second in worst case, because the server needs 9 extra seconds. How to handle this?

    Use an MQ software (zeromq, rabbimq, apache kafka etc). It is a doubly-linked list with pointers to undone tasks, if any. If you have a 10 one-second requests in one second, you just do them as fast as you can and use MQ as a storage.