Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Branch and Bound
#8
(Jul-26-2018, 06:38 PM)jarrod0987 Wrote: I don't quite get the purpose of the start = [] and if not sequence return start (I do know what if not does and I think this has to do with when the sequence runs out of items?)

You build the sequences one item at a time. That is, one item each call of the function. Start is the sequence build so far. At the beginning, it hasn't built anything yet, so the default is to have it be empty. Note that when we make the recursive call, the second (start) parameter is start + [item].

Again, read up on recursion. That's what is going on in my example.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Branch and Bound - by jarrod0987 - Jul-26-2018, 03:15 PM
RE: Branch and Bound - by ichabod801 - Jul-26-2018, 04:43 PM
RE: Branch and Bound - by jarrod0987 - Jul-26-2018, 04:57 PM
RE: Branch and Bound - by ichabod801 - Jul-26-2018, 05:18 PM
RE: Branch and Bound - by jarrod0987 - Jul-26-2018, 05:38 PM
RE: Branch and Bound - by ichabod801 - Jul-26-2018, 06:00 PM
RE: Branch and Bound - by jarrod0987 - Jul-26-2018, 06:38 PM
RE: Branch and Bound - by ichabod801 - Jul-26-2018, 06:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Confusion over an Except branch Mark17 1 483 Oct-13-2023, 07:45 PM
Last Post: deanhystad
  Program running on RPi 3b+ Very Strange Behavior - Out of Bound Index MadMacks 26 3,637 Mar-07-2023, 09:50 PM
Last Post: MadMacks
  Upper-Bound Exclusive Meaning Johnny1998 1 3,457 Aug-02-2019, 08:32 PM
Last Post: ichabod801
  Bound method Uchikago 1 2,208 Jul-26-2019, 04:43 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020