Talk:Topological sort: Difference between revisions

m
→‎J implementation: fix <lang J> tags (now <syntaxhighlight lang=J>)
(→‎Task Name?: no need to change anything, it is different)
m (→‎J implementation: fix <lang J> tags (now <syntaxhighlight lang=J>))
 
(6 intermediate revisions by 4 users not shown)
Line 5:
These are brief notes, and do not attempt to document the language itself.
 
<langsyntaxhighlight lang=J>dependencySort=: monad define
parsed=. <@;:;._2 y
names=. {.&>parsed
Line 12:
assert.-.1 e. (<0 1)|:depends
(-.&names ~.;parsed),names /: +/"1 depends
)</langsyntaxhighlight>
 
<code>parsed</code> is a list of lines. Each line is a boxed list of words. Each word is a boxed list of characters.
Line 95:
Here's that alternate implementation. The algorithm remains unchanged -- I have just represented the dependencies using a different data structure.
 
<langsyntaxhighlight lang=J>depSort=: monad define
parsed=. <@;:;._2 y
names=. {.&>parsed
Line 102:
assert.-.1 e. (i.@# e.S:0"0 ])depends
(-.&names ~.;parsed),names /: #@> depends
)</langsyntaxhighlight>
 
In other words, instead of using a connection matrix, we use lists of name indices. In other words, the result of <code>names i.L:1 parsed</code> is
Line 149:
:I guess we could re-name all the 'Sorting algorithms/*' to 'Sort/Magnitude/Algorithms/*' then this could slot in as 'Sort/Topological' (as we don't specify any algorithms). See [[wp:Sorting]]. (I used the word magnitude rather than their use of the word intensity). Then again, we could just leave the 'Sorting algorithms/*' as they are. --[[User:Paddy3118|Paddy3118]] 17:46, 10 August 2011 (UTC)
: All other sorts require full ordering, that is for any two elements a and b, the comparison a < b or a <= b is meaningful. Topological sort has only partial ordering: if a depends on c and b depends on d, and there are no other dependencies, a < b or a < d doesn't have to be defined: dbca, dcba, cadb, etc are all valid result. It's really quite different. --[[User:Ledrug|Ledrug]] 18:55, 10 August 2011 (UTC)
::+1 on leaving as-is. --[[User:Paddy3118|Paddy3118]] 06:48, 11 August 2011 (UTC)
 
:: What about leaving it here, making sure some of the good notes above (i.e it's about more than just sorting) are in the task description as background (excuse me if they already are), and giving a redirect? Or perhaps just wait till the new SMW code is in and we can find it through sorting if we like. --[[User:Dgamey|Dgamey]] 03:02, 30 August 2011 (UTC)
 
== External link and Captcha problem ==
 
I am trying to add a Forth entry to the Topological sort page. Even if I just add the header for the Forth section to the Erlang section, the system tells me that I have added a new external link and I have to solve a captcha.
 
I first tried without JavaScript: After solving the picture puzzle, the captcha tells me to copy something to an empty box, but there is no empty box, only a filled box; and I also don't see a way to tell the system that I am done.
 
Then I tried with JavaScript enabled: I have to click on a box and it gives me the green check mark (in one case I had to solve a picture puzzle first), but the page is not saved yet. When I press "Save Page" again, I get another message about a new link and again a captcha.
 
I am not sure that this is the right place for such user-interface issues, but I did not find anything that looked more appropriate, and the problem about reporting new links that are not there seems to be specific to this page (it has not occured on other pages I edited).
 
: I have added a stub Forth entry to the page for you to fill in. (Thanks) --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 21:44, 22 February 2016 (UTC)
 
Thanks, I have now added the content to the entry.
6,951

edits