2022-10-16 17:02:12 +0200 | received badge | ● Popular Question (source) |
2016-05-12 18:18:04 +0200 | commented answer | Using a lambda expression in digraphs fails for len(G.sinks())? Thanks for the clear explanation & the helpful link. Back to the algorithm drawing board. |
2016-05-12 18:15:15 +0200 | received badge | ● Scholar (source) |
2016-05-12 18:07:05 +0200 | received badge | ● Student (source) |
2016-05-12 17:40:47 +0200 | asked a question | Using a lambda expression in digraphs fails for len(G.sinks())? I'm gathering digraphs that have exactly one sink. This list comprehension works fine to find the 6 such digraphs of order 3 & put them in a list: However, I need this to work in a lambda expression to make it part of a larger calculation. However, creates an iterator that returns no entries. Creating a lamba expression creates the same unexpected zero-length iterator in digraphs, but that same iterator correctly finds the 6 single-sink digraphs if used in a for expression: So, what's the right way to generate the one-sink digraphs of order N directly in the digraphs() generator? |