Re: [jgrapht-users] Bizarre issue with TopologicalOrderIterator
Brought to you by:
barak_naveh,
perfecthash
From: Alexander H. <ale...@my...> - 2014-12-04 16:18:34
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The DAG internally uses HashSets/Maps to store vertices and edges, these cause the non determinism when iterating, so it is nothing you do :) Basically anything you compute by iterating over items in the set (or the key in the map) is non deterministic. The TopolOrderIterator uses these operations to compute the order, so it is non deterministic. Alex On 12/04/2014 03:43 PM, org...@io... wrote: >> On 2014-12-04T14:02:52 +0100 Alexander Herz >> <ale...@my...> wrote: >> >> That is java for you, data structures using hashes often use the >> value of references to compute the hash. Since the pointer values >> may change every run, the order things are iterated over may >> change every run (there is no guarantee that the n-th call to >> malloc in an application always yields the same address). In >> order to make your application deterministic and debugable you >> want to use LinkedHash.. data structures. These guarantee >> deterministic behaviour (in single threaded execution). > > Is this the case with the TopologicalOrderIterator (or the > DirectAcyclicGraph)? > > I only use structural equality and hashes derived from values, as > opposed to reference equality or Object.hashCode() in my own code. > > M > > ------------------------------------------------------------------------------ > > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and > Dashboards with Interactivity, Sharing, Native Excel Exports, App > Integration & more Get technology previously reserved for > billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > > _______________________________________________ > jgrapht-users mailing list jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAEBAgAGBQJUgIFvAAoJEGSriSINjxXwGh4IAKYZK+/r/MNh7oQrzxQx1a33 jaQSO7TruSUV76T8BUBI4XvpNNSN1i4MFuZwovSBa+uT434uMc9qLPEAnbrxJmEh bFpeFJaH9T7SkP5YUqG/9sSkvti6nD7uD/PiYSL7jl4xLZB113hP8nTO/X1YO1Hh IOhWZe49YMQE3HnNvlxq+UsQKxw9g88guNbpb6dFsZY7DXFcVRjAnmV10NwhiphX EbHB54RvyeDYij5rOTOrz0CKawGcZUcsQKWOK9mWrJjgITivzXNd5pTfVHTLUN+A sNdHTnW22cCVsFApJ2iBPNM5kdSN9zNctsBn4mm+omi/VRAmhKKI9G7qWLam/pk= =xlh5 -----END PGP SIGNATURE----- |