@Override
    public LinkDataDuplexMap select(List<Application> sourceApplications, TimeWindow timeWindow, int outSearchDepth, int inSearchDepth, boolean timeAggregated) {
        logger.debug("Creating link data map for {}", sourceApplications);
        final SearchDepth outDepth = new SearchDepth(outSearchDepth);
        final SearchDepth inDepth = new SearchDepth(inSearchDepth);

        LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
        List<Application> applications = filterApplications(sourceApplications);
        LinkSelectContext linkSelectContext = new LinkSelectContext(timeWindow, outDepth, inDepth, linkVisitChecker, timeAggregated);

        while (!applications.isEmpty()) {

            logger.info("depth search start. depth:{} -> {}, size:{}, nodes:{}", linkSelectContext.getOutDepth(), linkSelectContext.getInDepth(), applications.size(), applications);
            LinkDataDuplexMap levelData = applicationsMapCreator.createLinkDataDuplexMap(applications, linkSelectContext);
            logger.info("depth search end. depth:{} -> {}", linkSelectContext.getOutDepth(), linkSelectContext.getInDepth());

            linkDataDuplexMap.addLinkDataDuplexMap(levelData);

            List<Application> nextApplications = linkSelectContext.getNextApplications();
            applications = filterApplications(nextApplications);
            linkSelectContext = linkSelectContext.advance();
        }
        return virtualLinkHandler.processVirtualLinks(linkDataDuplexMap, linkVisitChecker, timeWindow);
    }
Breadth-first link search
not thread safe

@author emeroad
@author minwoo.jung
@author HyunGil Jeong
web/src/main/java/com/navercorp/pinpoint/web/applicationmap/map/BidirectionalLinkSelector.java