Content deleted Content added
Masterhatch (talk | contribs) Tags: Mobile edit Mobile web edit Advanced mobile edit |
|||
(11 intermediate revisions by 5 users not shown) | |||
Line 1:
{{WikiProject
{{WikiProject Computer science|importance=mid}}
}}
== Untitled ==
Something is wrong with the first sentence in the "Informally, the algorithm constructs a trie ..." paragraph -- some kind of copy-paste replacement error; haven't figured out exactly how to fix it yet. Looks like there isn't a clean version to go back to; the mismatched parenthetical expression hasn't changed since it was added (17:36, 27 July 2006). Anyone? [[User:Dvgrn|dvgrn]] 18:46, 19 September 2006 (UTC)
* Got rid of the obvious error, but may have introduced some subtle inaccuracy -- will have to study the algorithm some more to be sure. [[User:Dvgrn|dvgrn]] 20:40, 19 September 2006 (UTC)
Line 59 ⟶ 62:
In the presented example the word bab is mentioned among the words, but it is not represented in the automaton... Oh there is another automaton shown later ... the correct one ... the word this would be better replaced by "bellow" [[Special:Contributions/217.153.187.164|217.153.187.164]] ([[User talk:217.153.187.164|talk]]) 18:21, 27 October 2022 (UTC) sorry, I have to remember my account info
== Quadratic? ==
The phrase in the first paragraph (underlining is mine):
: Note that because all matches are found, there can be a <u>quadratic</u> number of matches if every substring matches
puzzled me. Quadratic with respect to what? Surely there cannot be more matches than strings, so it seems linear WRT the strings. [[User:Викидим|Викидим]] ([[User talk:Викидим|talk]]) 03:06, 22 July 2024 (UTC)
:The statement is meant to be "quadratic in length of input", where length of input is total number of characters. But that claim is wrong, it cannot be quadratic - it is a nice exercise to show that there's an instance with <math>\Theta(n \sqrt(n))</math> matches, and that it cannot be asymptotically more. [[User:Al-Quaknaa|Martin Koutecký]] ([[User talk:Al-Quaknaa|talk]]) 19:27, 9 October 2024 (UTC)
::Removed "quadratic". I think that the original statement implied that as the length extends, so does the potential number of entries in the dictionary. [[User:Викидим|Викидим]] ([[User talk:Викидим|talk]]) 23:39, 9 October 2024 (UTC)
:::I've made one more clarification. I think it's important to point out that, unlike with Knuth-Morris-Pratt, you cannot expect complexity linear in the length of the input, so linear in the length of input + output is the best possible. [[User:Al-Quaknaa|Martin Koutecký]] ([[User talk:Al-Quaknaa|talk]]) 11:11, 10 October 2024 (UTC)
::::Undid a part of your change. I do not understand the "longer" part: the input and output of the algorithm are two different data structures, comparing their lengths is definitely nontrivial. [[User:Викидим|Викидим]] ([[User talk:Викидим|talk]]) 17:58, 10 October 2024 (UTC)
:::::I don't understand what's the issue.
:::::The input is a collection of strings and we measure its length by counting the characters in it.
:::::The output is a set of pairs (i,j) such that string i appears at index j. The number of such pairs may be (much) larger than the length of the input.
:::::Since you were not happy with my phrasing, could you please come up with a better phrasing communicating the same fact? In my opinion, the current state is a downgrade from the incorrect statement that there may be quadratically many matches, but at least that conveyed that the "number of matches" really has to be a part of the complexity. This has now gotten lost. [[User:Al-Quaknaa|Martin Koutecký]] ([[User talk:Al-Quaknaa|talk]]) 13:10, 23 October 2024 (UTC)
::::::I have no read-made language as I in turn do not understand your concern. My points are simple:
::::::# While it is easy for me to understand the meaning of words ''string "aaaaa" requires more space than "a"'', I cannot easily imagine a straightforward comparison of sizes of the same string "aaaaa" and of a [[tuple]] (1,1). Either the assumptions shall be listed or the comparison adjectives skipped.
::::::# Similarly, the generic meaning of ''quadratic'' describes a relationship between x and y of the form y = O(x*x). When declaring something to be quadratic, the text should identify not only y, but x also.
::::::# I am not an expert, but to the best of my knowledge AC algorithm is used primarily to find the threat patters in the network traffic. It does not appear to me that the "a", "aa", "aaa", ... is a typical dictionary for this application. I would like therefore to add something along the lines of "pathological" or "atypical" to the description of this example (this requires a [[WP:RS]], of course).
::::::[[User:Викидим|Викидим]] ([[User talk:Викидим|talk]]) 21:44, 24 October 2024 (UTC)
|