 The transitive closure of a given DAG , with n vertices and m edges , may be constructed in time O ( <unk> ) by using either breadth @-@ first search or depth @-@ first search to test reachability from each vertex . Alternatively , it can be solved in time O ( <unk> ) where <unk> < 2 @.@ 373 is the exponent for fast matrix <unk> algorithms ; this is a theoretical improvement over the O ( <unk> ) bound for dense graphs . 
