Skip to content

Commit

Permalink
wip: edge comp
Browse files Browse the repository at this point in the history
  • Loading branch information
rvazarkar committed Jan 25, 2024
1 parent 2947746 commit 4e99b13
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions packages/go/analysis/ad/ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,6 @@ func GetADCSESC9aEdgeComposition(ctx context.Context, db graph.Database, edge *g
if err := traversalInst.BreadthFirst(ctx, traversal.Plan{
Root: startNode,
Driver: adcsESC9aPath1Pattern(edge.EndID).Do(func(terminal *graph.PathSegment) error {
log.Infof("Segment: %v", graph.FormatPathSegment(terminal))
victimNode := terminal.Search(func(nextSegment *graph.PathSegment) bool {
return nextSegment.Depth() == 1
})
Expand Down Expand Up @@ -1160,7 +1159,6 @@ func GetADCSESC9aEdgeComposition(ctx context.Context, db graph.Database, edge *g

lock.Lock()
path2CandidateSegments[caNode.ID] = append(path2CandidateSegments[caNode.ID], terminal)
log.Infof("added ca node %d", caNode.ID)
p2canodes = append(p2canodes, caNode.ID)
lock.Unlock()

Expand All @@ -1179,9 +1177,7 @@ func GetADCSESC9aEdgeComposition(ctx context.Context, db graph.Database, edge *g
return nextSegment.Node.Kinds.ContainsOneOf(ad.EnterpriseCA)
})

if caNode == nil {
return nil
}
log.Infof("Segment: %v", graph.FormatPathSegment(terminal))

lock.Lock()
path3CandidateSegments[caNode.ID] = append(path3CandidateSegments[caNode.ID], terminal)
Expand Down
4 changes: 1 addition & 3 deletions packages/go/dawgs/traversal/traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (s *pattern) InboundWithDepth(min, max int, criteria ...graph.Criteria) Pat
// Inbound specifies the next inbound expansion step for this pattern. By default, this expansion will use a minimum
// depth of 1 to make the expansion required and a maximum depth of 0 to expand indefinitely.
func (s *pattern) Inbound(criteria ...graph.Criteria) PatternContinuation {
return s.InboundWithDepth(1, 0)
return s.InboundWithDepth(1, 0, criteria...)
}

// NewPattern returns a new PatternContinuation for building a new pattern.
Expand Down Expand Up @@ -310,8 +310,6 @@ func (s Traversal) BreadthFirst(ctx context.Context, plan Plan) error {
if nextDescent, ok := channels.Receive(traversalCtx, segmentReaderC); !ok {
return nil
} else if pathTreeSize := pathTree.SizeOf(); pathTreeSize < tx.TraversalMemoryLimit() {
log.Infof("%s", graph.FormatPathSegment(nextDescent))

// Traverse the descending relationships of the current segment
if descendingSegments, err := plan.Driver(traversalCtx, tx, nextDescent); err != nil {
return err
Expand Down

0 comments on commit 4e99b13

Please sign in to comment.