Re: Help with effective algorithm

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



this is getting more a question than helping thread but anyway,

thinking outloud, seems to me it can go only two ways (as allways...)
either you have a data structure that supports your need (object graph->Tree
structure of some sort)
or you have a flat and fast data structure that is supported by a fast graph
rendering algorithm.

on the first option, you have a long construction time and a large memory
consumption.
on the other option, you have a "skinny" memory consumption, but a longer
construction time for each request.

seems to me, analyticly speaking, that it narrows down to one question (for
me at least):
how often do you query for these graphs/paths?
if its often, I would take the first approach, since all the paths are
visible and constructed,
if not... well I will not.

but : this is a question, not an answer. I am trying to learn something here
too. I am ignorant when it comes to performance and memory usage.


"Tamir Khason" <tamir-NOSPAM@xxxxxxxxxxxxxxxxx> wrote in message
news:eC4EOfhUFHA.628@xxxxxxxxxxxxxxxxxxxxxxx
> Picha, thank you for reply
>
>> why do you use a Hashtable to hold all the data in the first place?
> The data I recieve in input is two hashtables from selialized source first
> is ID/Value information
> the second is Parent/Child relation, where Child and Parent are IDs from
> first hashtable
>
>> why not go on the old safe tree structure?
> It makes sense if trees are small. We are speaking about at least 900K
> items with complicated relationships, thus the parsing of even just
> creation of TreeView will take a while
>
>> maybe each node will hold a HashTable to the child nodes?
> Not nessesery, 'cos it might be Child-Of-Child structures
>
> --
> Tamir
>
>> "Tamir Khason" <tamir-NOSPAM@xxxxxxxxxxxxxxxxx> wrote in message
>> news:%23k1G3UhUFHA.228@xxxxxxxxxxxxxxxxxxxxxxx
>>>I have parent-child hashtable with more then 900K items and I have to
>>>build all pathes for this. E.G
>>> Key ParentKey
>>> 1 0
>>> 2 1
>>> 3 2
>>> 4 8
>>> 5 3
>>> 6 1
>>> 7 3
>>> 8 7
>>> To build:
>>> 0-1-2-3-5
>>> 0-1-6
>>> 0-1-2-3-7-8-9-4
>>> This is just example.
>>>
>>> I tried 5 different algorithms, but noting gave me good performance.
>>> Please assist
>>>
>>>
>>>
>>>
>>> --
>>> What dot.NET? Just ask:
>>> "Please, www.dotNET.us !"
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: Help with effective algorithm
    ... The "line" structures quered very often, the rebuild procedure less in use, ... > or you have a flat and fast data structure that is supported by a fast ... you have a long construction time and a large memory ... >> The data I recieve in input is two hashtables from selialized source ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Performance Improvement of complex data structure (hash of hashes of hashes)
    ... Anno Siegel wrote: ... >> Here is the code that I'm using to build up this data structure. ... loop through and increment the ... I know that memory allocation in C is expensive, ...
    (comp.lang.perl.misc)
  • Re: data varification code logic
    ... > Sounds like you are trying to use the same filehandle for 2 different ... yes the file can fit in memory, ... > The best data structure seems to me to be a HoL (Hash of Lists, ...
    (comp.lang.perl.misc)
  • Re: Memory Management scares me
    ... I kind of regret not having gone into programming at that ... It wasn't so much the idea of memory leaks as the idea of ... > are the driving factors for selecting customized memory management. ... simply replicates the entire data structure on each iteration, ...
    (comp.lang.cpp)
  • Re: What does it mean to set large fields to null
    ... enough memory to load the graphic data into memory, ... It works hand-in-hand with the finalizer to provide client code with a well-defined API for ensuring that resources .NET has no way to explicitly manage are still released in a timely way when the client code is done with them, and a back-up system in case the client code has a bug and fails to release those resources explicitly. ... Even if you did have a data structure that could potentially allocate a large amount of memory and then later have a sensible use case where you would want to release that memory without releasing the entire data structure at all, I don't really feel that IDisposable is the right way to go about it. ... I agree with the design found, for example, in the Listclass where there's an explicit method specific to the type to accomplish that " method). ...
    (microsoft.public.dotnet.languages.csharp)