# Confused with Graph Command

**URL:** <https://community.wolfram.com/t/confused-with-graph-command/2993>\
**Category:** Questions\
**Tags:** mathematica, graphs-and-networks\
**Created:** [August 17, 2014, 9:28am UTC](https://community.wolfram.com/t/confused-with-graph-command/2993 "2014-08-17T09:28:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![enkidu](https://avatars.discourse-cdn.com/v4/letter/e/8c91f0/32.png) [@enkidu](https://community.wolfram.com/u/enkidu)\
**Post date:** [August 17, 2014, 9:28am UTC](https://community.wolfram.com/t/confused-with-graph-command/2993/1 "2014-08-17T09:28:54Z")

</div>

![graf_test.jpg](https://global.discourse-cdn.com/wolfram/original/3X/2/a/2a2296a387cbed5be660a313b811e978230034cb.jpeg)

Hi,

There seem to be two different “Graph” commands, although they have the same name.  
GraphQ does not recognize all graphs. What shall I load in which sequence, if I want to use  
some commands from graphutilities and from combinatorica? Command AdjacencyMatrix  
shows the same problem.

Best,

GG

---

<div class="post-metadata">

**Author:** ![sukrause](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sukrause/32/41348_2.png) [@sukrause](https://community.wolfram.com/u/sukrause)\
**Post date:** [August 17, 2014, 11:00am UTC](https://community.wolfram.com/t/confused-with-graph-command/2993/2 "2014-08-17T11:00:16Z")

</div>

The Wolfies say in [GraphUtilitiesPackage](http://reference.wolfram.com/language/GraphUtilities/guide/GraphUtilitiesPackage.html)

> As of Version 10, all the functionality of the GraphUtilities package  
> is built into the Wolfram System.

and present a Tutorial _Upgrading from GraphUtilities_ [GraphUtilities](http://reference.wolfram.com/language/Compatibility/tutorial/GraphUtilities.html) ensuring again

> As of Version 10, all the functionality of the GraphUtilities package  
> is built into the Wolfram System.

So, in the best of all worlds - which is by the way just ours - you are allowed to do nothing about it: do not load GraphUtilities any more.

---

<div class="post-metadata">

**Author:** ![mthiel](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mthiel/32/42877_2.png) [@mthiel](https://community.wolfram.com/u/mthiel)\
**Post date:** [August 17, 2014, 11:01am UTC](https://community.wolfram.com/t/confused-with-graph-command/2993/3 "2014-08-17T11:01:10Z")

</div>

Hi GG,

I think that it is a little bit of a problem to use functionality from both graphutilities and combinatorica at the same time. As the error message says combinatorica is conflicting with the built-in functionality.

I did manage to use functionality from both in one notebook, and switch between the packages, using CleanSlate:  
[http://library.wolfram.com/infocenter/TechNotes/4718/](http://library.wolfram.com/infocenter/TechNotes/4718/)

This piece of code should work after CleanSlate is installed.

(_goto [CleanSlate Package -- from Wolfram Library Archive](http://library.wolfram.com/infocenter/TechNotes/4718/) and   
follow the instructions_)

```
In[1]:= ClearAll["Global`*"]

In[2]:= RandomGraph[{20, 50}]

In[3]:= << Utilities`CleanSlate`

In[4]:= Needs << Combinatorica`
 
In[6]:= GraphPlot[RandomGraph[50, 0.1]]

In[7]:= Names["Combinatorica`*"]

In[9]:= g = RandomGraph[50, 0.1]

In[10]:= ListPlot[DegreeSequence[g]]

In[11]:= CleanSlate["Combinatorica`"]

During evaluation of In[11]:= (CleanSlate) Contexts purged: {Combinatorica`}

During evaluation of In[11]:= (CleanSlate) Approximate kernel memory recovered: 2999 Kb

Out[0]= {"Utilities`CleanSlate`", "TemplatingLoader`", \
"PacletManager`", "System`", "Global`"}

In[1]:= RandomGraph[{20, 50}]

```

It is important that you load “CleanSlate”, before (!) you load Combinatorica. After that you can (in theory) load and unload Combinatorica functionality. The notebook is attached as well. This is not a good solution to your problem, but it might be a first step.

Cheers,

Marco

---

<div class="post-metadata">

**Author:** ![biancaeifert](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/biancaeifert/32/1245_2.png) [@biancaeifert](https://community.wolfram.com/u/biancaeifert)\
**Post date:** [August 19, 2014, 7:40am UTC](https://community.wolfram.com/t/confused-with-graph-command/2993/4 "2014-08-19T07:40:20Z")

</div>

Hi GG,

you could also call any conflicting or shadowing symbols by their full names, that is, including the name of their context:

```
Combinatorica`Graph

```

is not the same as

```
System`Graph

```

as you can see by evaluating their respective usage messages:

```
?Combinatorica`Graph
?System`Graph

```

I admit that this is a bit cumbersome because of the additional typing work, but it will allow you to access functions of the same name coming from different packages in a controlled way.

~ Bianca
