# Why are some functions available without having to load their parent package?

Functions such as GraphDistanceMatrix[] or AdjacencyMatrix[] are available without invoking

Needs["GraphUtilities"]


.

Why isn't the whole package available when Mathematica starts? Are the functions different after having loaded GraphUtilities?

-
Those are simply different functions with the same name. The package was available in older versions, the built-in functions are new in 8. – Szabolcs Mar 21 '12 at 10:10

If you look at their Contexts, you'll see that all of them are in the System context and not the GraphUtilities context.

Context /@ {GraphDistanceMatrix, CharacteristicPolynomial, AdjacencyMatrix}
Out[1]= {"System", "System", "System"}


Some packages are preloaded when the kernel starts — System is one of them, whereas GraphUtilities is not. You can see all packages that are pre-loaded with $Packages $Packages
Out[2]= {"ResourceLocator", "DocumentationSearch", "GetFEKernelInit",
"JLink", "PacletManager", "WebServices", "System", "Global"}

-
@CHM: Which functions are you concerned about. For CharacteristicPolynomial, for example, it $must$ be the System context because evaluating ?GraphUtilities* does not show any function of the same name in that context. – murray Mar 21 '12 at 20:02
@murray I've noticed that CharacteristicPolynomial[] is not in GraphUtilities. Edited, thanks. I'm concerned not with a particular example, but with the fact that some functions might have two different definitions when loading a package. – CHM Mar 21 '12 at 20:08
@CHM: Yes, multiple definitions can be a problem. This seems to happen mostly with add-on packages that are still shipped with Mathematica but whose functions have not yet been moved into the kernel. Of course if you load a package and get shadowing messages, that's a sure tip-off. And you can always qualify the name of a function provided in a package by including the package's context when calling it. – murray Mar 22 '12 at 0:17