Coder Social home page Coder Social logo

Depth-first search on a graph about gatb-core HOT 7 CLOSED

gatb avatar gatb commented on August 18, 2024
Depth-first search on a graph

from gatb-core.

Comments (7)

rchikhi avatar rchikhi commented on August 18, 2024

Hi Michael,

Actually the reason why you'd want to do a BFS in such a case, is because doing a DFS might get you to traverse the whole graph due to repeated kmers. BFS enables to control the depth of traversal, related to genomic proximity. I.e. BFS with depth at most 1000 guarantees that you will find all paths of length at most 1000. DFS over at most, say 100,000 nodes, might get stuck following a repeated kmer and end up at a completely different location in your genome. Does that make sense?

Rayan

from gatb-core.

mbhall88 avatar mbhall88 commented on August 18, 2024

Hi Rayan,

Thanks for the quick response.

In my current example I do want to traverse the entire graph to ensure I have found every possible way of getting from my start kmer to my end kmer. Additionally, I don't expect these dBGs to be very large, they will most likely be built from sequences that should not span more than ~1000bp (in many cases will likely only be in the order of 50bp).

Another reason we were leaning towards DFS was it's ability to detect cycles.

Michael

from gatb-core.

rchikhi avatar rchikhi commented on August 18, 2024

I see. Actually, I cannot find an example of DFS in our code, only BFS. It could be easier to just fix your current DFS code, can you paste the part regarding cycle detection?

from gatb-core.

rchikhi avatar rchikhi commented on August 18, 2024

Found some (old) code that does a simple DFS using recursion:

void Simplifications<GraphType,Node,Edge>::heuristic_most_covered_path_old(

from gatb-core.

mbhall88 avatar mbhall88 commented on August 18, 2024

Thanks Rayan - I really appreciate you taking the time.

I think I may have fixed my implementation. Will do some more rigorous testing on some corner cases tomorrow. If not, I will provide some code.

from gatb-core.

rchikhi avatar rchikhi commented on August 18, 2024

sure, just let us know

from gatb-core.

mbhall88 avatar mbhall88 commented on August 18, 2024

Yes, it seems to be working now. Apologies for taking up your time. And thank you again for your assistance.

from gatb-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.