Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8682985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:55:18+00:00 2026-06-12T21:55:18+00:00

The Hitchhiker’s guide to Algorithms discusses the following pointers: 1.6 Counting or Optimizing Good

  • 0

The Hitchhiker’s guide to Algorithms discusses the following pointers:

1.6 Counting or Optimizing Good Paths
In an n × m grid, we want to go from the left bottom corner to the upper right corner. Each 
time we can only take a step to the right, or a step up. The number of ways we can do this 
is exactly (n+m)!/(n! * m!).  But what if we forbid some points on the grid? For example, if we   
forbid all the points above the line y = x. Some of the problems has answer in closed formula. 
But all of them can be solved quickly by dynamic programming.

Problem 1.6 Given a directed acyclic graph, how many paths are there from u to v? What is the longest one if there are weights on the edges?

My question is how are the two problems related? What is the relation between the grid here and a DAG. On stackoverflow itself I read that if we’re moving in only two directions in the grid then we can assume it’s a DAG. The question may sound very naive, but I’m a beginner and any help will be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:55:19+00:00Added an answer on June 12, 2026 at 9:55 pm

    Every point in the grid is a vertex. You have m * n vertices.
    There is an edge going from each vertex to the vertex representing the point on its left and from each vertex to vertex representing the point on its top.

    This way the DAG represents the grid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read this statement in Hitchhiker's guide to algorithms. But, I'm not able to
After going over the Hitchhiker Guide to Packaging and some other blog posts I
I was following the code in http://www.haskell.org/haskellwiki/Hitchhikers_guide_to_Haskell , and the code (in chapter 2)
Suppose I'm creating a class called Hitchhiker. package hi.my.name.is { public function Hitchhiker():void {
I know base 13 is not practical. However, i was checking out The Hitchhiker's
I'm learning about Python Packages from Learn Python the Hard Way and one of
I'd like to parse the content of an .opf-file (that's a file that contains
I have a Python module that I would like to upload to PyPI. So
We all know that 42 is the answer to everything , but it's news
I have to files that I need to combine together using Apache PIG. First

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.