Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-358

Early return/termination for graph visit

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Graph

      Description

      Hello,

      the current implementations in the class Visit (package org.apache.commons.graph.visit) do not include the possibility to stop the search prematurely. That would be more natural (and faster) for many kinds of search, e.g. when looking for the first occurrence of a specific pattern (vertex, path with certain features, etc).

      The easiest solution: changing all method signatures in GraphVisitHandler from void to boolean, forcing the handler to answer the question: should I continue?

      I understand semantics get a bit entangled (well, not with an appropriate documentation!), so I am open to more verbose options: e.g. a method isSearchComplete to call after every step... but that would only be more verbose, wouldn't it?

      Waiting for feedback and ready to patch
      Claudio

        Attachments

          Activity

            People

            • Assignee:
              simone.tripodi Simone Tripodi
              Reporter:
              claudio.squarcella Claudio Squarcella
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified