     :publications "pubs"
     :cascades cascades
     :assignments "tagrefs"
+    :unknown "unknown"
     :unrelated))
 
 

(defn lifetime
  "Computes lifetime of contact set"
  [cs]
  (let [sorted-cs (sort-by :ts cs)]
    (t/in-seconds (t/interval (last cs) (first cs)))))


(defn density

      ((comp float /) (reduce + (map #(mc/count @db % {:ts {$lt t0}}) contacts))
         (* node-count (dec node-count))))))

(defn subset-size
  "Computes size of given contact set"
  [cs]
  (zipmap
   (keys cs)
   (map count (vals cs))))


(defn intercontact-times
  "Computes average inter-contact times"
  [cs]
  (zipmap
   (keys cs)
   (map
    (fn [sub-cs]
      (let [sorted-cs (sort-by :ts sub-cs)]
        (reduce + #(t/in-seconds (t/interval (:ts %1) (:ts %2))))))
    (vals cs))))


(comment

