type stats = {
  srcgraph : srcgraph_stats;
  buildgraph : buildgraph_stats;
}

type srcgraph_stats = {
  snr_vertex : int;
  snr_edges : int;
  type1cycles : (srcpkg * binpkg list * binpkg list) list;
  type2cycles : (srcpkg * binpkg list * binpkg list) list;
  type3cycles : (srcpkg * binpkg list) list;
}

type buildgraph_stats = {
  bnr_vertex : int;
  bnr_edges : int;
  sccs : sccstats list;
}

type sccstats = {
  sg_vertex : int;
  sg_edges : int;
  cycles : vertex list list;     (* smallest cycles *)
  cycleedge : edge stat; (* edges with most cycles *)
  builddeps : (srcpkg * binpkg list) list; (* least build deps missing *)
  ratio_source : (srcpkg * int * binpkg list * srcpkg list) list;
  ratio_binary : (binpkg * int * srcpkg list) list;
  weak : (srcpkg * binpkg list) list;
  srcbinstats : (vertex * int * int) list;
  fas : (srcpkg * binpkg list) list;
  sap : vertex stat;
  sb : edge stat;
}

type 'a stat = ('a * int) list
type 'a fstat = ('a * float) list

(* debian package = name, arch, version *)
type binpkg = (string * string * string)

(* debian source package = name, version *)
type srcpkg = (string * string)

type vertex =
    [ SrcPkg of srcpkg
    | InstSet of (binpkg * binpkg list)
    | SCC of (srcpkg list) ]

type edge = (vertex * vertex)
